ServerJS/Concurrency: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(New page: One should probably try to follow the [http://www.whatwg.org/specs/web-workers/current-work/ WebWorkers API] as far as it makes sense on the server. However, WebWorkers cannot share state...)
 
m (correcting URL)
 
Line 14: Line 14:
* JavaScript Strands adds coroutine and cooperative threading support to the JavaScript language http://www.xucia.com/strands-doc/index.html
* JavaScript Strands adds coroutine and cooperative threading support to the JavaScript language http://www.xucia.com/strands-doc/index.html
* Erlang-style concurrency with JavaScript 1.7 http://www.beatniksoftware.com/erjs/index.html
* Erlang-style concurrency with JavaScript 1.7 http://www.beatniksoftware.com/erjs/index.html
* Threading in Javascript 1.7 http://www.neilmix.com/2007/02/07/th...javascript-17/
* Threading in Javascript 1.7 http://www.neilmix.com/2007/02/07/threading-in-javascript-17/

Latest revision as of 13:28, 4 June 2009

One should probably try to follow the WebWorkers API as far as it makes sense on the server.

However, WebWorkers cannot share state, they can only communicate via messages, so if traditional threads are desired they are not acceptable.

And traditional threads are generally considered deprecated in modern language design. The WebWorkers design was intentional.

A possible alternative is a stronger eventing dispatch mechansim. Actionscript did lots of good work in this area. Here is a set of event, listener and timer classes from Ejscript. These can be retro fitted to interpreters for which threads and threading are problematic or impossible.