7.2. Waiting for I/O

Many types of input / output (I/O) do not occur immediately. So the process must wait in a waiting queue and the device driver needs a strategy of how to effectively wait for I/O data.

7.2.1. Polling

Polling is not very efficient because the system must continually check the device for data.

Note

I can not remember where I read this, but it is my understanding that only joy–sticks (game ports) use polling in modern operating systems.

../_images/polling.png

7.2.2. Interrupt Driven

../_images/interrupt-driven.png

It is more efficient to start an I/O peripheral doing a task and let it interrupt the system when the I/O operation is finished.

The interrupt driven approach causes drivers to consist of a top and bottom half.