Possible Duplicate:
Why doesn't JavaScript support multithreading?
Is there some way to spawn new threads for running tasks (for network stuff or some heavy calculations) to work in parallel?
Possible Duplicate:
Why doesn't JavaScript support multithreading?
Is there some way to spawn new threads for running tasks (for network stuff or some heavy calculations) to work in parallel?
Yes and no.
You can use Web Workers to create background threads, but it's far from all browsers that support that. Internet Explorer for example doesn't have support for it until version 10.
In regular Javascript code there is no multi threading. Javascript is a strictly single threaded language.
Yes, via web workers. See documentation: https://developer.mozilla.org/en-US/docs/DOM/Using_web_workers?redirectlocale=en-US&redirectslug=Using_web_workers
JS does not directly support multithreading but I believe you could emulate it by using several IFRAMES running a same script or different scripts. I'm just speculating.