Node has support for multi-core processors and thread-like workers using the cluster module. Cluster allows you to run multiple node processes (workers) that share sockets and memory cache lines, so this completely eliminates about 3/4 of the problems you were experiencing. They have essentially the same performance as user-level threads (which are the standard on *nix anyway) so there’s no performance gain using traditional user-level threads vs node workers. Kernel-level threads such as those in Windows will likely perform worse because of context switching.

Written by

Entrepreneur. Engineer. Educator.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store