u/totorodenethorin r/node • Recommends
Non-blocking I/O and how Node uses it, in friendly terms
#non-blockingio#eventloop#asynchronousio
41K subscribers • 2 videos on Hallway
Beginner. No background in the topic needed.
101K views5 years ago1 recommendation
Systems programmingProgramming languagesConcurrency and parallelismNode.js, Deno and BunOperating systems
An explanation of blocking versus non-blocking asynchronous I/O and how Node.js handles CPU and I/O tasks.
The work of fulfilling a request can be split into two pieces: CPU work, which is actively running code and performing calculations, and I/O work, which is waiting for something else to happen. Normally, threads performing I/O must wait until the I/O is complete to continue processing, which is called blocking or synchronous I/O. Non-blocking or asynchronous I/O is an optimization available in some technologies (NodeJS, Java NIO, and others) that allows threads to move on to other work while the I/O is happening in the background. Feel free to ask questions in the comments below! Intro Servers & Threads A Server Is Like A Restaurant A Request Has CPU work (active time) and I/O work (inactive time) Code Example Nonblocking I/O Timing Diagram Blocking I/O Timing Diagram Why Isn't Nonblocking I/O More Common? Downsides Of Nonblocking I/O RecapWhat people say. Recommended as a friendly and clear explanation of non-blocking I/O and how Node.js handles concurrency.
u/totorodenethorin r/node • Recommends