Possible Duplicate:
JavaScript multithreading
When I open a web page in browser, how many threads are started to render the DOM and execute the Javascript code?
Is it possible to execute Javascript functions with multi-threads?
Possible Duplicate:
JavaScript multithreading
When I open a web page in browser, how many threads are started to render the DOM and execute the Javascript code?
Is it possible to execute Javascript functions with multi-threads?
You can make the use of webworkers in modern browsers
The short answer is no, you cannot run multithreaded code in javascript.
The longer answer is that you can simulate it. This question on SO might be helpful: Multithreaded JavaScript how to?
You can use WebWorkers for threads, but it cant work with dom. Also you may try simulate it by setInterval
Another idea that people use at times is to make use of iframes. If your application can be modeled as set of iframes(like facebook), you can leverage this. Google chrome is highly optimized for this. Javascript in each frame executes in a separate execution context and hence can be parallelized.