Issue
I am trying to understand how the node.js works, and in the features of node.js, I read the following statement:
Node.js is a single-threaded but highly scalable system that utilizes JavaScript as its scripting language. It uses asynchronous, event-driven I/O instead of separate processes or threads. It is able to achieve high output via single-threaded event loop and non-blocking I/O.
What does being a single-threaded system mean?
Solution
Thread
In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system.
That means that a thread is a simple flow of instruction. An application can be single threaded (so imagine it as a single line going from the entry point of the application to its end) or multi-threaded (imagine a tree: the whole app starts from 1 point, than it branches out more and more).
Single threaded processes contain the execution of instructions in a single sequence. In other words, one command is processes at a time.
The opposite of single threaded processes are multithreaded processes. These processes allow the execution of multiple parts of a program at the same time. These are lightweight processes available within the process.
- Single-threaded and Multi-threaded Processes by David Meador
Answered By - G.D Udara Lahiru Sampath Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.