I/O multiplexing

term

programming

Kept in this browser · My desk

Watching many sockets or files with one call that reports which of them are ready to read or write, so that one thread can serve many connections.

The classic call is select(), which the Linux manual limits to descriptors below FD_SETSIZE (1024), advising modern applications to use poll() or epoll() instead; BSD systems offer kqueue(). Python's select module exposes these calls, and its selectors module wraps them behind one interface, with DefaultSelector choosing the most efficient one the platform has (epoll on Linux). With non-blocking sockets it checks hundreds of devices in the time of one timeout, and it is what asyncio's event loop runs underneath.

Also known as: select(), poll(), epoll, kqueue, selectors, DefaultSelector

← Back to I Back to the glossary