W3C home > Mailing lists > Public > public-html@w3.org > June 2008

Re: Race conditions in HTML 5?

From: Jim Jewett <jimjjewett@gmail.com>
Date: Tue, 10 Jun 2008 14:18:28 -0400
Message-ID: <fb6fbf560806101118q7e47f95fh1fadb970b2d330a2@mail.gmail.com>
To: "HTML WG" <public-html@w3.org>

Bonner, Matt wrote:
>> ... several places ... where a UA is required
>> to start executing something once all other scripts
>> have stopped ...
>> possible ...race  conditions, or deadlock, ...

Boris Zbarsky wrote:
> for that to happen you have to have some code
> that blocks on the result of the script execution, ...

For a deadlock maybe, but not for a race condition.

If you have 10 events queued up waiting for "as soon as no scripts are
executing", then order can matter.

It would be enough to say "add this to a queue of events to process as
soon as no scripts are executing" and specify FIFO.  (Or LIFO, or any
other order, so long as it is defined.)

To give a more concrete example, what if there is a newly inserted
source element and an event stream whose first event will cause
removal of that source?

Does the first one queued up win?  The last?
If the event source wins, does that cancel the loading?  (Even if it
already started?)  Or does the loading proceed because it was already
queued up?

-jJ
Received on Tuesday, 10 June 2008 18:19:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:18 GMT