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:
| Process | Allocation (A,B,C) | Request (A,B,C) | ||||
|---|---|---|---|---|---|---|
| P0 | 0 | 1 | 0 | 0 | 0 | 0 |
| P1 | 2 | 0 | 0 | 2 | 0 | 2 |
| P2 | 3 | 0 | 3 | 0 | 0 | 0 |
| P3 | 2 | 1 | 1 | 1 | 0 | 0 |
| P4 | 0 | 2 | 2 | 0 | 0 | 2 |
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
- The Bounded Buffer problem is also known as the ________.
- Two atomic operations permissible on semaphores are ________ and ________.
- Three processes share a single counting semaphore S whose initial value is 1. All three execute wait(S) one after another, in the order P2,…
- In the UNIX operating system, when a process creates a child process using the fork() system call, which of the following is genuinely shar…
- A system has 12 instances of a resource R shared among four processes. The maximum need and current allocation of each process are: Process…
- Match List I with List II