All mock tests are FREE till 31 December — register to save your progress

Consider a system with five processes P0 through P4 and three resource types A, B and C, with 7, 2 and 6 total instances respectively. At time T0 the system state is:
ProcessAllocation (A,B,C)Request (A,B,C)
P0010000
P1200202
P2303000
P3211100
P4022002
Available = (0, 0, 0). Applying the deadlock detection algorithm, the system is:

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. Not in deadlock state

Explanation

Running the detection algorithm with Work = Available = (0,0,0): P0's request (0,0,0) ≤ Work, so it can finish, releasing its allocation and raising Work to (0,1,0). P2's request (0,0,0) ≤ (0,1,0) finishes next, raising Work to (3,1,3); then P3's request (1,0,0) ≤ (3,1,3) finishes, raising Work to (5,2,4). Now P4's request (0,0,2) ≤ (5,2,4) finishes, raising Work to (5,4,6), and finally P1's request (2,0,2) ≤ (5,4,6) also finishes. Since the sequence lets every process obtain its request and complete, no process is stuck waiting forever, so the system is not in a deadlock state.

More Computer System Architecture questions