I am learning through the architecture of Node.js. I have following questions.
- Is event loop a part of libuv or v8?
- Is event queue a part of event loop? are event queue generated by libuv or v8 engine or event loop itself?
- What is the connection between libuv and v8 engine?
- If event loop is single threaded, does libuv come into picture to create multiple threads to handle File I/O?
- Does browsers have event loop mechanism or just Node.js does?
The event loop is, first and foremost, a high-level concept that's a fundamental part of the JavaScript programming model. Practically, every V8 embedder needs to implement an event loop. V8 provides a default implementation, which embedders can replace or extend.
I don't understand the question. (I guess the answer is "yes", but what's the difference between "event loop" and "event queue"?)
None. (Except that Node.js uses both.)
Yes, the event loop is single-threaded.
Yes, browsers have an event loop too (see question 1).