W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2007

[whatwg] Asynchronous database API feedback

From: Oliver Hunt <oliver@apple.com>
Date: Tue, 11 Dec 2007 15:02:43 -0800
Message-ID: <77A39CF7-7EE4-448B-9BFE-170A1459C184@apple.com>

>
> It's clear that most people here feel passionately that this is the
> wrong thing to do. Perhaps it's best that we table this until
> something like workerpools are in the spec.

Worker pools do not resolve the problem, even if you were to force  
any synchronous IO to be performed on a worker thread (where by force  
i mean attempting synchronous io on the main/ui thread would throw an  
exception or similar).  The problem is that once you have multiple  
threads, and those threads are unable to modify the DOM (allowing the  
DOM to be modified from a worker thread would cause too much havoc --  
there is much to much JS out there to allow JS to become  
multithreaded), so either you defer the synchronous IO into a async  
callback model to tell you when the io has completed -- you are now  
using the synchronous api to implement your own async api -- or you  
have thread constructs such as a rendezvous, which will eventually  
end up in the UI thread, thereby reducing any thread synchronous IO  
back into a blocking operation.

--Oliver

>
> - a
Received on Tuesday, 11 December 2007 15:02:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:38 UTC