How Concurrency and throughput is handled?
Node JS is single threaded so callback functions are sent to event loop where after completing other processes callback function is executed. To ensure concurrency event loop efficiently handles non-JavaScript operations such as I/O operations and concurrent code is executed aterwards.
Non-blocking asynchronous operations are much faster as compared to Blocking synchronous operations. This is different in JavaScript as most other languages create multiple threads to handle concurrency
Blocking and Non-Blocking in Node
Node is based on an event-driven non-blocking I/O model. This article discusses what does Blocking and Non-Blocking in Node means.
Table of Content
- What is Blocking?
- What is Non-Blocking ?
- How Concurrency and throughput is handled?
- Drawback of mixing Blocking and Non-Blocking Code
Contact Us