In a previous post, we discussed how Node.js is a single-threaded environment and still manages to serve multiple requests simultaneously: Node.js event loop: concurrent processing in a single-threaded environment. This is a good way to avoid the problems that come along with multi-threading like race conditions. But this extra peace of mind comes at a … Continue reading async_hooks: behind the scenes of Node.js http request context handling
Category: Node.js
Node.js event loop: concurrent processing in a single-threaded environment
When you start a Node.js application by running node index.js, you are in fact creating a Node.js process in which your code will run. Every process has a dedicated memory pool which is shared between its threads. Or in other words, you can create a variable in one thread and read it from another. While … Continue reading Node.js event loop: concurrent processing in a single-threaded environment
