1 min readApr 27, 2016
If you use cluster.fork() to spawn new processes instead of using the main process you will be able to solve the same problem without the use of threads. Threads needs a lot of considerations and I think most problems can be better handled with an actor model and cluster instead of introducing threads.
The following code runs on 1.156s on my Macbook Pro:
https://gist.github.com/irony/d44cbda0c71707e89274edd63fcc3d35