DEV Community

Discussion on: Everything you need to know about Node.js

Collapse
 
shmdhussain12 profile image
Mohamed Hussain

Thanks for this clear article on how the things are done in background using nodejs....I have some question : what is the difference between worker threads and os threads....in prime number example why os threads are not used by default by libuv when doing CPU heavy task...what is the limit for the os threads...

Collapse
 
pierreyveslebrun profile image
Pierre Lebrun

As said in the article, your code must be written in C++ in order to be able to use the OS threads pool.

Hence the introduction of worker threads which can be used directly in JS.

Collapse
 
jorge_rockr profile image
Jorge Ramón

Yeah, he is right :D.

That's why DB drivers are written in C++.