Consider the following snapshot of a system running concurrent processes. Process is holding instances of a resource , . Assume that all instances of are currently in use. Further, for all , process can place a request for at most additional instances of while holding the instances it already has. Of the processes, there are exactly two processes and such that . Which one of the following conditions guarantees that no other process apart from and can complete execution?
GATE CSE 2019Operating System › Deadlocks & Resource AllocationVerified
GATE CSE 2019 PYQ: Consider the following snapshot of a system running n n n concurrent processes. Process i i i is holding X i…
- ACorrect answer
- B
- C
- D
Answer
(A) X p + X q < Min { Y k ∣ 1 ≤ k ≤ n , k ≠ p , k ≠ q } X_p + X_q < \text{Min} \{Y_k \mid 1 \leq k \leq n, k \neq p, k \neq q \} X p + X q < Min { Y k ∣ 1 ≤ k ≤ n , k = p , k = q }
Approach
Determine how many resources become available after processes p and q finish, then check whether that amount is insufficient for every other process's maximum remaining request.
Once p and q finish, only $X_p+X_q$ instances of $R$ become available. To guarantee that no other process can complete, every other process must require more than this amount, i.e. $X_p+X_q \< \min_{k\neq p,q} Y_k$. Thus option A is correct.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.