Priority inheritance temporarily raises the lock holder's priority to that of the blocked high-priority thread.
The holder can then run, release the lock, and reduce priority inversion.
Correct Answer: C. Allow exactly the smoker with the missing ingredient to proceed after the agent supplies the other two
Explanation:
The problem tests selective signaling among several waiting processes based on a combination of resources.
Correct synchronization wakes the one eligible smoker without deadlock or incorrect consumption.
Correct Answer: B. No participating thread passes the barrier until all required threads have arrived
Explanation:
A barrier synchronizes phases by holding early arrivals until the complete group reaches the same point.
A reusable barrier resets so the group can synchronize again in later phases.
Correct Answer: A. Synchronizing one service provider with a limited waiting area and arriving customers
Explanation:
The sleeping-barber problem represents customers arriving, waiting when seats exist, or leaving when full.
The barber sleeps when no customer is present and must be awakened safely.
Correct Answer: D. Impose a global order on forks and acquire them in that order
Explanation:
Resource ordering prevents a cycle because all philosophers request forks according to one consistent order.
Without a cycle in resource requests, circular wait cannot occur.
Correct Answer: C. Each philosopher may hold one fork while waiting in a circular chain for the other
Explanation:
The simultaneous left-fork acquisition creates hold-and-wait and circular-wait conditions.
No philosopher can obtain the second fork, so none releases the first.
A continuous arrival of readers can repeatedly postpone a waiting writer.
Fair or writer-priority policies are used when bounded waiting for writers is required.
Correct Answer: A. No reader should wait unless a writer already has permission to use the shared object
Explanation:
The first readers-writers formulation favors readers when no writer is currently active.
Multiple readers may enter together, which can delay waiting writers.
Correct Answer: D. The number of occupied buffer slots containing items
Explanation:
The full semaphore prevents a consumer from removing an item when the buffer is empty.
A producer increments it after placing a new item in the buffer.
Correct Answer: C. The number of unused buffer slots
Explanation:
The empty semaphore prevents a producer from inserting when no free slot remains.
It is decremented before insertion and incremented after a consumer removes an item.
A read-write lock exploits workloads where concurrent reads are safe but writes must be exclusive.
It can improve concurrency compared with one ordinary mutex for all access.
A reentrant lock records the owner and an acquisition count for repeated locking by that owner.
The lock becomes available to others only after a matching number of releases.