On 3/08/2010 9:20 a.m., Ian Hickson wrote:

The synchronous section would run as soon as the task span the event loop.
Spinning the event loop is defined essentially as being equivalent to
breaking the original task in two, one that does everything up to spinning
the event loop, and one that does everything after spinning the event
loop. You are effectively waiting for some condition to become true and
then queueing a task to run the continuation of the algorithm. It's just
more convenient to write the algorithms as one long set of steps rather
than having split them up into multiple algorithms that invoke each other
and pass state around.

Or does "stop the currently running task" in #spin-the-event-loop imply
a jump to step 2 of the algorithm under #processing-model2?
Yes.


So the task spinning the event loop has run up to the point of spinning the event loop, then we run the synchronous section, and then the task which was spinning the event loop will resume after its goal is met at some later time?

In the case of a tasks which invokes an algorithm which has a synchronous section, and then pauses the event loop (such calling window.alert()), we should not run the synchronous section until the event loop pause has completed?

Thanks,
Chris Pearce.

Reply via email to