PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 20, 2022

[FIXED] What is meant by a single-threaded, event-driven I/O system?

 October 20, 2022     node.js     No comments   

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.

- Wikipedia

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing