CS FundamentalsHardGATE CS · Product-company placement
A low-priority task L holds a mutex needed by high-priority task H. A medium-priority task M, which does not need the mutex, becomes ready and keeps running, so H misses its deadline. Which fix targets this problem directly?
- A. Give H a longer time slice
- B. Raise L's priority to H's while L holds the mutex that H waits for
- C. Replace the mutex with a spinlock
- D. Lower M's priority below L's permanently
Correct answer: B. Raise L's priority to H's while L holds the mutex that H waits for
This is unbounded priority inversion. Priority inheritance (or a priority ceiling) lets L run at H's priority until it releases the mutex, so M cannot preempt it. A spinlock would make H burn CPU while L still cannot run.
More Operating Systems questions
- In a monitor with Mesa (signal-and-continue) semantics, why must a consumer check its condition with while (count == 0) wait(notEmpty)…
- Five dining philosophers each pick up the left fork and then the right fork. Which change removes the possibility of deadlock without a…
- A user creates file f, makes a hard link h to it and a symbolic link s to f. Then f is deleted and a NEW file named f is created with…
- In the standard five-state process model (new, ready, running, blocked, exit), which transition can NOT happen directly?
- A program uses user-level threads mapped many-to-one onto a single kernel thread. One thread calls a blocking read() on a slow device…
- A bounded-buffer producer is written as wait(mutex); wait(empty); add item; signal(mutex); signal(full); while the consumer is the usual…