Question about Node.js event loop vs Browser's event loop

I understand that the Node.js event loop performs non-blocking I/O operations in a single-threaded environment. What I need to clear about is that I have also learned there is another event loop built into the browser, for example, chrome’s v8 engine has its own event loop. Since Node.js executes javascript code using chrome’s v8 engine, does that mean it is the same event loop that browsers execute their Javascript code with. If Node.js has its own implementation of the event loop, then how is it implemented to work with libuv library?

I think node.js uses libuv under the hood, as stated in node’s dependency documentation.

On the other hand the browsers uses libevent, I think. I was not able to find a reliable source for this.

Regardless the two models should be pretty similar.

Hope this helps.

So basically, the event loop for nodejs is entirely handled by libuv, and for browsers it’s libevent?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.