= Polled input-output
In <polled input-output>, the <CPU> explicitly checks a device's status to discover whether work is ready or an operation has completed. Repeatedly checking in a tight loop is busy polling; periodic checks can instead leave time for other work. <Interrupt-driven input-output> changes how readiness is discovered, while <DMA> changes how payload data moves. https://pages.cs.wisc.edu/~remzi/OSTEP/file-devices.pdf[Arpaci-Dusseau and Arpaci-Dusseau, OSTEP chapter 36, sections 36.3–36.5: polling, interrupts and DMA]{ref}
Use the model drawn under <interrupt-driven input-output>: device events occur at times $2,5,9$, while polls occur at $0,2,4,6,8,10,12$. Assume each event remains pending until detected and an event simultaneous with a poll is visible to that poll. The detection times are $2,6,10$, giving delays $0,1,1$. Four of the seven checks find no new event. These are event-detection delays, not completion times for servicing the events.
More generally, for polls at $0,\Delta,2\Delta,\ldots$ with $\Delta>0$, an event at time $t\geq0$ is first detected at
$$
d(t)=\Delta\left\lceil\frac{t}{\Delta}\right\rceil,\qquad 0\leq d(t)-t<\Delta.
$$
The <ceiling function> chooses the first poll at or after the event. To verify the bound, that poll is less than one interval beyond $t$; if $t$ is itself a poll time, the delay is zero by the stated visibility convention. This argument assumes instantaneous checks, persistent pending status and an uninterrupted poll schedule. It does not describe missed transient events or a <CPU> too busy to maintain that schedule.
The attraction of <polled input-output> is simple control and the possibility of processing several ready items in one visit. Busy polling spends <CPU> time even when nothing is ready, but short waits or frequent events can make avoiding repeated <interrupt> entry worthwhile. The right choice depends on actual checking, notification and service costs. See <interrupt-driven input-output> for a documented combination of both strategies. https://pages.cs.wisc.edu/~remzi/OSTEP/file-devices.pdf[Arpaci-Dusseau and Arpaci-Dusseau, OSTEP chapter 36, section 36.4: polling and interrupt tradeoffs]{ref}
// Destination: computer-science.bigb
Back to article page