Answer the question
In order to leave comments, you need to log in
How are low-level operations distributed across threads?
There is an Event Loop in node.js. It also contains requests to C++ libraries. When a library request is made, EL continues with other events on the stack. But how is the simultaneous execution of library services and the main event loop organized? Each request creates a separate thread, or can an actor be created for each service, or maybe all services are managed by an engine that creates actors one-time according to some optimized scheme?
I would like to understand more deeply how work with threads is going on at the system level. Any interesting solutions on this topic from the "how could it be" series will also do.
Answer the question
In order to leave comments, you need to log in
Here is a good article on the subject.
And here and here in more detail.
I do not understand the question. If you want to understand node deeper, see the source codes. There is no more efficient way.
EventLoop is nothing but
while(1) {
// а здесь тысячи if и switch
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question