The I/O reactor is based on functions such as poll()
, epoll()
, select()
and others (kqueue()
), which allow grouping I/O handlers (sockets, file descriptors, named pipes, etc.) together, allowing guaranteed sequential processing of I/O.
The reactor consists of worker threads, each of which is bound to its own processor in the system - context switching without changing the processor is much faster than with it.
Inside the worker threads, events on the descriptor are processed in a conditionally infinite loop. An event socket is bound to each descriptor.
Chapters
- dap_events - events that begin and end the main processing loop
- dap_worker - a worker that processes requests with events sockets
- dap_context - a context of processing
- dap_events_socket - events sockets which are tied to the worker