CS FundamentalsHardGATE CS

Priority-based preemptive scheduling with L (low), M (medium), H (high). L arrives at t=0 and needs 10 units; at t=1 L locks a mutex and holds it for 5 units of its own execution. M arrives at t=2 and needs 6 units (no lock). H arrives at t=3, needs 4 units and requests the mutex as its first action. Ignoring switch cost, at what times does H finish without and with priority inheritance respectively?

  1. A. 16 and 7
  2. B. 12 and 11
  3. C. 14 and 7
  4. D. 16 and 11

Correct answer: D. 16 and 11

Without inheritance M (which does not need the lock) runs 3-8 ahead of L, L finishes its critical section during 8-12, and H runs 12-16. With inheritance L runs at H's priority from t=3, releases at t=7, and H runs 7-11.

More Operating Systems questions

Exams that ask this topic