JavaScript is a single-threaded language and since Node.js is more of an environment to run JavaScript outside of a browser, we could say that Node.js is also single-threaded.īut, it is crucial to understand that while the code we write runs on a single thread with an event loop in the same thread, certain operations performed by some Node libraries that interact with the underlying operating system might use a multi-threaded approach.įor instance, the crypto library in Node uses the libuv library internally, which is written in C, and libuv has access to a thread pool. In this article let’s quickly look at the threading architecture in Node.js, understand its limitations and also discuss four different techniques through which we could overcome those limitations. Although it is true, there is some nuance to this statement. There is a high probability that you have already heard or read somewhere that Node.js is single-threaded.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |