Question:medium

A keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer polls the keyboard every 10 ms, each poll takes 100 \(\mu s\). If a key is detected, an additional 200 \(\mu s\) is used for processing. Let \(T_1\) be the fraction of a second spent in polling and processing a keystroke. In an alternative implementation with interrupts, each keystroke requires 1 ms to service and process. Let \(T_2\) be the fraction of a second in the interrupt method. Find the ratio \(T_1/T_2\).

Show Hint

Polling wastes CPU time because it repeatedly checks the device even when idle, while interrupts only use CPU when actual input arrives. This is why interrupt-driven I/O is far more efficient in practice.
Updated On: Jan 31, 2026
Show Solution

Correct Answer: 10.2

Solution and Explanation

Was this answer helpful?
0