The Multi-Threaded Request/Response Stateless Model is not followed by the Node JS Platform, and it adheres to the Single-Threaded Event Loop Model. If Node.js is single-threaded, then how does it handle concurrency? By doing async processing on a single-thread under typical web loads, more performance and scalability can be achieved instead of the typical thread-based implementation. Node.js is single-threaded for async processing. Once the task is carried out completely, the response is sent to the Event Loop that sends that response back to the client. This thread is responsible for completing a particular blocking request by accessing external resources, such as computation, database, file system, etc.
0 Comments
Leave a Reply. |