JavaScript multithreading
- by Krzysztof Hasinski
I'm working on comparison for several different methods of implementing (real or fake) multithreading in JavaScript. As far as I know only webworkers and Google Gears WorkerPool can give you real threads (ie. spread across multiple processors with real parallel execution). I've found the following methods:
switch between tasks using yield()
use setInterval() (or other non-blocking function) with threads waiting one for another
use Google Gears WorkerPool threads (with plugin)
use html5 web workers
I read related questions and found several variations of the above methods, but most of those questions are old, so there might be a few new ideas.
I'm wondering - how else can you achieve multithreading in JavaScript? Any other important methods?
UPDATE: As pointed out in comments what I really meant was concurrency.
UPDATE 2: I found information that Silverlight + JScript supports multithreading, but I'm unable to verify this.
UPDATE 3: Google deprecated Gears: http://code.google.com/apis/gears/api_workerpool.html