CS FundamentalsHardGATE CS (PYQ pattern)

Polling a device costs a fixed 10% of the CPU (100,000 polls/s at 1 microsecond each) plus 0.5 microseconds of handling per event. Interrupt-driven I/O with coalescing raises one interrupt per 4 events; each interrupt costs 5 microseconds and each event also needs 0.5 microseconds of handling. Above what event rate (events/s) does polling use less CPU time?

  1. A. 80,000
  2. B. 22,222
  3. C. 20,000
  4. D. 100,000

Correct answer: A. 80,000

Polling: 0.1 + 0.5 x 10^-6 r. Coalesced interrupts: (5/4 + 0.5) x 10^-6 r = 1.75 x 10^-6 r. Equal when 1.25 x 10^-6 r = 0.1, r = 80,000 events/s. Without coalescing (5 + 0.5 per event) it would be 22,222; ignoring the handling cost on both sides with uncoalesced interrupts gives 20,000.

More Operating Systems questions

Exams that ask this topic