[whatwg] Asynchronous database API feedback

Oliver Hunt oliver at apple.com
Tue Dec 11 15:02:43 PST 2007


>
> 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




More information about the whatwg mailing list