Friends, please explain who used these modules, what is the difference between them, judging from the documentation of the cluster module, it creates a new process and an IPC channel between them for communication, and how does worker_threads work? Is it something like channels in golang? Judging from the documentation of this module, it creates a new lightweight stream on the new kernel. For example, I need to calculate a huge array, what is preferable to use in this case? How does the worker_threads module behave in single-processor systems? Is the worker_threads module a replacement for cluster? Where and when it is better to use it because the node itself is asynchronous.
- nodejs.org/api/worker_threads.html the first three paragraphs of the same description. And do not forget that this is an experimental module - Alexey Ten
|