CS FundamentalsHardGATE CS
Interrupt-driven I/O vs polling: a device produces one byte every 1 ms and checking its status register costs 1 µs, while taking an interrupt costs 10 µs. Which is cheaper in CPU time per byte, assuming the CPU polls exactly once per byte (it knows the timing)?
- A. Interrupts (no CPU cost at all)
- B. They are equal
- C. Polling, because it never wastes cycles even with unpredictable devices
- D. Polling (1 µs per byte vs 10 µs)
Correct answer: D. Polling (1 µs per byte vs 10 µs)
When arrival times are predictable and the device is fast relative to polling cost, polling wins. For unpredictable or slow devices polling wastes cycles on empty checks, and interrupts are better.
More Operating Systems questions
- Which statement about DMA is correct?
- A spooler is used for a printer. Which deadlock condition does spooling break for the printer resource, and how?
- Semaphores s = 2, t = 0. Process X runs repeat 2 times { wait(s); print('A'); signal(t); } and Y runs repeat 2 times { wait(t)…
- Shared x = 0. Three threads each execute x = x + 1; once (load, add, store; no locking). What is the set of possible final values?
- Shared x = 0. Thread A executes x = x + 1; twice and thread B executes x = x - 1; twice, with no synchronisation (each statement is load…
- Semaphores a = b = c = 0. P1: print A; signal(a); wait(b); wait(c); print X. P2: print B; signal(b); signal(b); wait(a); print Y. P3…