http://stackoverflow.com/questions/36490779/node-architecture-is-libuvs-event-loop-exposed-to-v8

At the end of this article 
<http://%20https://medium.com/@ghaiklor/how-nodejs-works-bfe09efc80ca#.tvs22y5oy>
 *(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 
<https://github.com/nodejs/node/blob/master/src%2Fnode.cc#L4276> leads 
after some steps to the creation of a new Environment 
<https://github.com/nodejs/node/blob/master/src%2Fenv-inl.h#L215> instance. 
The constructor is passed a newly created V8 Context 
<https://developers.google.com/v8/get_started#null>, 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 
<https://github.com/nodejs/node/blob/master/src%2Fenv-inl.h#L48> instance. 
I couldn't find a hint that the loop is actually passed or registered to 
V8. Nor that the Environment::New belongs to the V8 namespace, as said at 
the end of the article.

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. 



-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to