![The Backend Engineering Show with Hussein Nasser artwork](https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/cd/d5/bb/cdd5bbe4-0e12-9615-1bd5-6f578f2e6875/mza_5436295260688338257.jpg/100x100bb.jpg)
When is NodeJS Single Threaded and when is it multi-Threaded?
The Backend Engineering Show with Hussein Nasser
English - March 24, 2021 03:08 - 9 minutes - 6.25 MB - ★★★★★ - 5 ratingsTechnology Homepage Download Apple Podcasts Google Podcasts Overcast Castro Pocket Casts RSS feed
Node JS Is single-threaded asynchronous non-blocking javascript runtime, but it's not always single-threaded there are occasions where nodejs uses multi-threading, so the questions we will try to answer in this video, when is nodejs single-threaded and when does it use multi-threading and how will that affect my app?
Event Loop single thread, that really just loops for callbacks 0:00
Threading in Node jS (libuv) 4:00
used for
IO/intensive
DNS queries
file system reads
CPU intensive
crypto
compression
process.env.UV_THREADPOOL_SIZE=1
Examples 8:00
Cluster Nodejs 16:00
Example 1
HTTP server return 1
HTTP server while 1
HTTP server with file system read async
HTTP server with file system read sync
HTTP server with fetch call to server (dns)
Support my work on PayPal
Become a Member on YouTube
https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join
🧑🏫 Courses I Teach
https://husseinnasser.com/courses