CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ
A low-priority task L holds a mutex. High-priority H blocks on it, and medium-priority M (which does not need the mutex) becomes ready. Under the priority-ceiling protocol where the mutex's ceiling is H's priority, what happens?
- A. M preempts L, because M has a higher priority than L
- B. L already runs at H's priority, so M cannot preempt it
- C. H preempts L and takes over the mutex while L waits
- D. L is aborted so that the mutex is released for H at once
Correct answer: B. L already runs at H's priority, so M cannot preempt it
With immediate priority ceiling, a task takes the ceiling priority as soon as it locks the mutex, so M cannot preempt L while L is in the critical section, and H's blocking is bounded. Without such a protocol M could delay H indefinitely.
More Operating Systems questions
- A semaphore S starts at 7. Over time 20 wait() and 15 signal() operations complete on it, in some order, with no process left blocked at…
- A Unix process opens a file, forks, and both parent and child each write 100 bytes to the inherited descriptor (no OAPPEND, no seeks), one…
- Which statement about the convoy effect is correct?
- Disk cylinders 0–199; the head is at 120 moving toward 199; requests: 10, 22, 20, 2, 40, 6, 38. Counting the return jump as head movement…
- Which property of a journaling file system's ordered mode is correct?
- A process's address space uses three-level paging with 9 bits per level and 4 KB pages (8-byte entries, so each table is one 4 KB page)…