Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs does every worker thread need a new core

A worker thread in node.js is an actual OS thread running in 
  a different instance of V8. As such, it's totally up to 
the operating system to decide how to allocate it among 
available CPU cores. If there are cores with available time, 
  then it will not generally be run on the same core as the
  main nodejs thread when that thread is busy because the OS
  will allocate busy threads across the various cores.

But, again this is entirely up to the OS and is not something 
that nodejs controls and the exact strategy for which cores 
are used will vary by OS. But, in all modern operating systems, 
  the design goal is that available cores are used for threads 
  that are currently executing. Now, if there are more threads 
  active at once than there are cores, the threads will be 
  time-sliced and all the cores will be active.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nodejs #worker #thread #core
ADD COMMENT
Topic
Name
7+3 =