Revision 93494 of Concurrency

  • Revision slug: CommonJS/Concurrency
  • Revision title: Concurrency
  • Revision id: 93494
  • Created:
  • Creator: Mob
  • Is current revision? No
  • Comment 51 words added

Revision Content

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.

Revision Source

<p>One should probably try to follow the <a class="external" href="http://www.whatwg.org/specs/web-workers/current-work/" title="http://www.whatwg.org/specs/web-workers/current-work/">WebWorkers API</a> as far as it makes sense on the server.</p>
<p>However, WebWorkers cannot share state, they can only communicate via messages, so if traditional threads are desired they are not acceptable.</p>
<p>And traditional threads are generally considered deprecated in modern language design. The WebWorkers design was intentional.</p>
<ul> <li><a class="external" href="http://www.synchro.net" title="http://www.synchro.net">Synchronet</a>'s <em>load()</em> method supports creating background tasks/threads and implements a bidirectional <em>Queue </em>object which may be used to communicate with the concurrently executing child script: <a class=" external" href="http://synchro.net/docs/jsobjs.html#Queue">http://synchro.net/docs/jsobjs.html#Queue</a></li>
</ul>
<p>A possible alternative is a stronger eventing dispatch mechansim. Actionscript did lots of good work in this area. <a class="external" href="http://www.ejscript.org/products/ejs/doc/api/gen/ejscript/ejs.events-classes.html" title="http://www.ejscript.org/products/ejs/doc/api/gen/ejscript/ejs.events-classes.html">Here</a> 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.</p>
Revert to this revision