Blocking: the call waits until the operation completes. Non-blocking: it returns immediately (often with a would-block error) if the operation cannot complete. Asynchronous: the operation is started and completion is notified later (callbacks, signals, io_uring on Linux).
select and poll watch many file descriptors but scan the whole list on every call (linear in the number of descriptors); epoll (Linux) registers descriptors once and returns only the ready ones, which scales to tens of thousands of connections, and is the basis of event loops in nginx, Node.js and Python's asyncio.
A thread-per-connection server wastes memory and context switches at high connection counts; an event loop with non-blocking I/O handles many connections on a few threads.
Loading…