At the end of this article (section EventLoop) it says that libuv's event loop is passed to V8. On the first reading that seemed to make sence: In the browser V8 has it's own event loop, in Node it gets that of libuv. But then I started digging into the code and couldn't find a proof where the loop is passed to V8. StartNodeInstance leads after some steps to the creation of a new Environment instance. The constructor is passed a newly created V8 Context, which is created from a V8 isolate, as well as a pointer to the libuv default loop. Then the loop is passed to the creation of a IsolateData instance. I couldn't find a hint that the loop is actually passed or registered to V8. Nor that the An isolate is a V8 VM instance with its own heap. A context is an execution environment that allows separate, unrelated, JavaScript code to run in a single instance of V8. You must explicitly specify the context in which you want any JavaScript code to be run. |