Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (55.6k points)

Can anyone explain the Node Js is single-threaded?

1 Answer

0 votes
by (119k points)

Node.js was developed explicitly as an experiment in asynchronous processing. The theory suggests that using async processing on a single thread gives more performance and scalability under typical web loads compared to the typical thread-based implementation.

And you know what? According to me, that theory's been borne out. A node.js app that isn't doing CPU intensive stuff can run thousands more concurrent connections compared to other thread-based servers.

Single-threaded and asynchronous nature makes things complicated. And, do you believe that it's more complicated than threading? One race condition can fail your entire month or empty out your thread pool because of some setting somewhere and watch your response time slow to a gradual decrease. No to mention deadlocks, priority inversions, and all the other gyrations that go with multithreading.

To summarize, I don't think it is better or worse but it's different, and sometimes it's better and sometimes it's not. Use the right tool for the job.

If you want to learn Node Js from an online course, I would recommend this Node Js Certification by Intellipaat

Also, watch this video on Node Js:

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jun 16, 2020 in Web Technology by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
asked Sep 9, 2020 in Web Technology by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Sep 9, 2020 in Web Technology by Sudhir_1997 (55.6k points)

Browse Categories

...