In an alternative implementation, the system uses interrupts instead of polling. An interrupt is raised for every keystroke. It takes a total of for servicing an interrupt and processing a keystroke. Let denote the fraction of a second spent in servicing the interrupt and processing a keystroke.
The ratio is _____________. (Rounded off to one decimal place)
View worked solution
Answer: 10.2
To find the ratio , we calculate the fraction of time spent by the CPU in both the polling and interrupt-driven implementations over a duration of second.
1. Polling Implementation ()
- Polling frequency: The system polls every .
- Time spent in polling: Each poll takes .
- Processing time: There is keystroke per second. Processing this keystroke takes an additional .
- Total time spent ():
2. Interrupt-driven Implementation ()
- Interrupt frequency: An interrupt is raised for every keystroke. Since there is keystroke per second, there is interrupt per second.
- Time spent servicing and processing: It takes to service and process each keystroke.
- Total time spent ():
3. Ratio
Free practice · Your answers on this page are not saved.
