GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A processor services interrupts with nested priorities: a higher-priority interrupt (larger number) preempts a running lower-priority handler immediately, and a pending handler runs only when no higher-priority handler is active. Handlers (P: priority 1, arrives at t = 0 µs, needs 12 µs; Q: priority 2, arrives at t = 3 µs, needs 6 µs; R: priority 4, arrives at t = 5 µs, needs 3 µs; S: priority 3, arrives at t = 7 µs, needs 4 µs) have no overhead. At what time (µs) does handler P finish?

  1. A. 25
  2. B. 27
  3. C. 28
  4. D. 22

Correct answer: A. 25

Total work is 25 µs, but P finishes only after every higher-priority handler that arrives before it completes. Simulating µs by µs gives completion times {'R': 8, 'S': 12, 'Q': 16, 'P': 25}.

More Computer Organization and Architecture questions

Exams that ask this topic