[OpenLayers-Dev] threading/synchronicity in javascript

rldhont rldhont at gmail.com
Sat Nov 1 06:38:02 EDT 2008


The World Wide Web Consortium is considering the possibility to execute 
JavaScript code in an independent thread. The idea is to load a 
JavaScript File and execute it in an other thread. This is the DOM 
Worker Threads proposition for HTML5 (like drag & drop API or 
geolocationAPI)
 http://www.whatwg.org/specs/web-workers/current-work/

Mozilla implements a first version of this work and will be usable in 
Firefox 3.1.
https://developer.mozilla.org/en/Firefox_3.1_for_developers

I don't know about it in Google Gears or in other browser engine.

Nikolas Coukouma a écrit :
> 2008/11/1 Erik Uzureau <euzuro at gmail.com>:
>   
>> Dear OpenLayers users & dev,
>>
>> Pardon the non-geo post, but I am wondering if anyone out there has come up
>> across issues with
>> synchronicity in javascript?
>>
>> After pouring over this stuff for several hours, I think I am pretty
>> resolved to just say "ok, javascript
>> is event-driven and not truly multithreaded, so there is no need to worry".
>>     
> I can't comment on other implementations (MS IE/JScript,
> Safari/WebKit, Opera), but in (Spidermonkey and now
> Tracemonkey)/Firefox:
> Javascript is only ever executed from one thread. There are other
> threads, but they're primarily used for things like DNS lookup and
> insert events that are handled by the main thread.
>
> Execution of a piece of code *can* be preempted, but only at very
> specific points, basically at the start and/or end of a block (e.g.
> exiting a function or the top of a for loop).
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
>   




More information about the Dev mailing list