event demultiplexer
The part of libuv that waits on many sockets and files at once and reports which of them are ready, using facilities such as epoll.
In more detail
Instead of one thread per connection, a single call asks the kernel to wake the program when any watched descriptor has data. The ready events are then turned into callbacks on the event loop.
Related terms
- libuv — The C library inside Node.js that runs the event loop, performs asynchronous I/O and manages the thread pool.
- epoll — The Linux kernel facility that lets one thread watch many file descriptors and be told which are ready for reading or writing.
- kqueue — The event notification facility on macOS and BSD systems, doing the job epoll does on Linux and also reporting file changes.
- I/O completion ports — The Windows mechanism for high-performance asynchronous I/O, which libuv uses on Windows instead of epoll or kqueue.
Taught in
- libuv Architecture: Event Demultiplexer & Thread Pool — Node.js Internals & Backend Services
- Poll & Check Phases: I/O Callbacks & setImmediate — Node.js Internals & Backend Services