>>>>> "n" == nick <[EMAIL PROTECTED]> writes:
>> that is so we don't dispatch events between every op code.
n> Why not? - hardware does.
n> Also once event is posted we keep going into the decrement loop
n> for all the ops until we decide to do it.
n> I don't think despatching every op is a big deal - if events are
n> cropping up fast enough for it to be an issue we are in trouble
n> anyway.
i won't fight that. as dan has agreed, we will have replaceable op
loops. this is used for inline event dispatching. the smaller one is
used for when you do an event loop or manual event handling.
>> NOTE: the event dispatch call will eventually recurse to the op code
>> loop to execute the event handler.
n> No it won't - it will return to the outer one having pointed "the"
n> op pointer and the new op stream. Indeed in my mental model event
n> despatch is either inline:
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.
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.
>> this is more likely to be used when code generating inline checks. every
>> Nth op code would be a event_check_op. this has a weakness of what if
>> you have a very tight perl loop that doesn't exceed N ops? will events
>> ever get dispatched then? the op loop counter method works better there.
n> Neither solves the long running single op case.
yes. we will always have that. unless certain long running ops can
periodically save state, call the event checker and dispatcher and have
themselves be pushed onto the stack. and when the events are done, this
op has to be popped off the stack and continued from its checkpoint.
lotta work there IMO.
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com