Non-blocking I/O lets a thread continue executing while it waits for input or output data. Instead of becoming blocked on one device, it can handle other work while the operating system gathers results. section 10.5
Operating systems can batch data from multiple sockets into queues and poll those queues periodically. Asynchronous programming supplies the control flow for responding when devices or other threads signal that work is ready. section 10.5
Non-blocking I/O changes the trade-offs of I/O-heavy programs:
- Avoids waiting for one I/O request to finish before continuing. section 10.5
- Can improve runtime by reducing system calls and user-space/kernel-space context switches. section 10.5
- Requires more complicated control flow because external I/O events affect execution order. section 10.5




