[Nestedvm] runtime.call() question

David Barr david20708 at gmail.com
Mon Jun 22 12:40:14 EDT 2009


I'm porting a C application, and I'm trying to make as few changed to
the application as possible and get it running under NestedVM within
an Android application.  The program calls a function to read input
from the user.  I've modified that function to use _call_java() to get
the value from Java UI routines.  I don't return a value from this
function until there is input available, so most of the time the
application will be blocked waiting for input.

My question is whether or not I can use runtime.call() to call a
function in my C code while the program is still running but blocked
and waiting for input.  The reason for this is I want to implement
auto-save functionality in the program.  I'm pretty sure that the
function that I want to call won't modify any data that will confuse
the program because it is being called out of order.

In my first attempt at solving this problem, I just had the function
that was requesting input return EOF when I needed to auto-save.  This
caused the C program to auto-save the data and exit.  The problem is
that I don't want the program to exit, because the startup code takes
a relatively long time and requires interaction with the user.



More information about the Nestedvm mailing list