[whatwg] Race condition in media load algorithm

Boris Zbarsky bzbarsky at MIT.EDU
Mon Aug 2 12:39:34 PDT 2010

On 8/2/10 3:11 PM, Ian Hickson wrote:
>> How are we defining "current asynchronous task" and "finish"?
> In terms of the event loop algorithm:
>     http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#processing-model-2

Ah, I see.  Is the note there about synchronous sections having no 
side-effects something that is true by default due to the way 
synchronous sections are used in the specification?

>> How does this setup handle cases when the "current asynchronous task"
>> spins the event loop, if at all?
> The spinning of the event loop is also defined in terms of the event loop
> in a manner that strictly defines this:
>     http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#spin-the-event-loop

I'm not sure I follow the steps here, actually.  Just to make sure I do 

Say I have a task T in the event queue.  Task T begins some algorithm 
that has a synchronous section, then spins the event loop.  If I 
understand the steps in #processing-model-2 correctly, the synchronous 
sections would run after task T completes, not while task T is spinning 
the event loop?  Or does "stop the currently running task" in 
#spin-the-event-loop imply a jump to step 2 of the algorithm under 

(Note: I still have a problem with the way "pause" is defined here, but 
I've raised that before, I believe.)


More information about the whatwg mailing list