Node tells the operating system (via epoll , kqueue , /dev/poll or select ) that it should be notified when a new connection is created, and then it goes into sleep mode. If someone new connects, he makes a callback. Each connection represents only a small heap distribution.
It is event driven, where it processes IO in asynchronous (non-blocking I / O) mode. It internally executes the threads necessary to process epoll , kqueue , /dev/poll or select , but for you as a user / client it is completely transparent.
eg. epoll is actually not a thread pool, but an OS I / O event notification tool that node.js sits on top of.
tolitius
source share