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?
- A. 80,000
- B. 22,222
- C. 20,000
- 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
- In Lamport's bakery algorithm five processes P0 to P4 hold tickets (number, id): P0 has 4, P1 has 3, P2 has 4, P3 is not competing (0) and…
- A 200 KB heap is managed with a first-fit free list; adjacent free blocks are merged when memory is freed. Operations in order: alloc…
- A fixed-size job runs 6 times faster on 8 cores than on 1 core. Assuming Amdahl's law holds exactly (a serial fraction f, the rest…
- Three philosophers sit at a table with three forks; philosopher i always picks up fork i (left) first and then fork (i+1) mod 3 (right)…
- A data TLB has 64 entries organised as 16 sets of 4 ways (set index = virtual page number mod 16, LRU within a set). A loop touches…
- The enhanced clock algorithm uses (R, M) bits with 3 frames (initially empty, newly loaded pages get R = 1 and M = 1 if loaded by a…