nanogui@linuxhacker.org
nanogui@linuxhacker.org
Greg & NanoGUIers,
Since our programs run in the same process as the nano-X-server, I was
wondering if you had some suggestions with how to deal with timeouts.
I was thinking since we want to be real lightweight that we might
include it in the GsSelect(void) loop. Some sort of function in the
NanoGUI API to insert timeouts so that when GsSelect calls select() it
will set the timeout to be configurable, and call the appropriate
function.
Something like:
struct Timeout {
void * func_to_call;
void * some_data; /* maybe a union here? */
time_t how_log;
}
Then have an array of timeouts ordered on when they are due, and run
the select() in GsSelect, check for all the timeouts that are due, and
take it from there. Basically I want that damned clock to spin
without moving my mouse! Just joking, but more seriously we probably
should support this internally rather than starting to pull events out
of the main loop of Nano-X. (This would be elemental if we were to
support any sort of animation running inside nano-X, unless we start
pulling these things out as processes..., but my thoughts are that
doing so would be "Bad News" for low CPU powered portables..., not to
mention the memory drain of fork; and allies) (I'm not a big fan of
sig alarm either..., breaking execution != good idea)
Shane.
nanogui@linuxhacker.org