ServerJS/Concurrency

From MozillaWiki
< ServerJS
Revision as of 02:19, 5 February 2009 by Kdangoor (talk | contribs) (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...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.