2 ms·
> If you want parallelism, you'll need to add it yourself I guess that's the way to go. The article you mentioned has an interesting demo : https://github.com/
by netgusto 10y ago
> If you want parallelism, you'll need to add it yourself
I guess that's the way to go. The article you mentioned has an interesting demo : https://github.com/chaudhryjunaid/multicore-demo/blob/master/bin/multicore.js https://github.com/chaudhryjunaid/multicore-demo/blob/master...
Though I'll yet have to figure out how to share the server state between the server workers then. Thanks for your answer.
- netgusto 10y agoMaybe more appropriate even than the node "cluster" in this demo is https://github.com/xk/node-threads-a-gogo https://github.com/xk/node-threads-a-gogo > Why threads ? > 4.- The threads of a process share exactly the same address space, that of the process they belong to. Every thread can access every memory address within the process' address space. This is a very appropriate setup when the threads are actually part of the same job and are actively and closely cooperating with each other. Passing a reference to a chunk of data via a pointer is many orders of magnitude faster than transferring a copy of the data via IPC.