Search code examples
node.jsv8serverside-javascript

Multiprocessor with v8 and node.js


I was reading that V8 isn't multithreaded, and can't be by design.

Is this true? Is it really the case that I can have a script optimized to run concurrently (on node.js) but that concurrency can't extend to multiple processors? I kinda thought that was a major reason for a concurrent design.


Solution

  • As for node.js, it's not concurrent but asynchronous. There's a single thread, and a single event loop, that handles all IO in node.js.

    There are some tools for concurrency in node.js, that mostly revolve around multiple processes. But like all of node.js, they are in the early stages of development. For example, you can manage multiple worker processes using fugue, or you can use the possibly familiar Web Workers API using node-worker.