Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
If I understand correctly Node JS is non blocking...so instead of waiting for a response from a database or other process it moved on to something else and checks back later.
Also it is single threaded.
So does all this mean that a given Node JS process can fully and efficiently utilize a single CPU core but it will not use any other core on the machine, as in, it will never use more than one at a time.
This of course means that the other CPUs can still be used by other processes for things like SQL database or other intentionally separated CPU heavy subroutines as long as they are a separate process.
Also in the event that the Node JS process has an endless loop or long running function, that process is no longer useful in any way until the endless loop or long running function is stopped (or whole process killed).
Is all this right? Am I correct in my understanding?
Pretty much correct, yes. The node.js server has an internal thread pool so it can perform blocking operations and notify the main thread with a callback or event when things complete.
So I imagine that it will make limited use of another core for the thread pool, for example if you do a non-blocking file system read this is likely implemented by telling a thread from the thread pool to perform a read and set a callback when it's done which means that the read could be happening on a different thread/core while the main node.js program is doing something else.
But from a node.js point of view, it's entirely single threaded and won't directly use more than one core.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.