Uri Guttman <[EMAIL PROTECTED]> writes:
>
>  n>    push(op_ptr);
>
>fake recursion. :) this is simpler, saving the old op to a stack. you
>need to also deal with popping that back when the handler is done. 

Again using hardware as a model I would like an event "context switch"
to look like a "call" to a sub. So the "push" above mimics what a sub call
would do. (Or we may want something more like an RTOS's "ready queue",
a bit like Malcolm's "fake threads".)

The point being if we "return" to the (plugable) tight loop
then there is only one place to mess with if we change our minds.

>
>  n>    op_ptr = event_flag; // it _is_ the ops we want to do
>  n>    event_flag = NULL;
>
>do you mean event_flag is set to the actual op to handle the event? cute
>use of a value based flag.

It is my personal style to use non-NULL value as "flag" - it dates 
back to "my" RTOS on TI's 16-bit micros where memory was precious - 
having a flag and a value was wasteful.

-- 
Nick Ing-Simmons

Reply via email to