Suppose there are four processes in execution with 12 instances of a Resource…
2016
Suppose there are four processes in execution with 12 instances of a Resource R in a system.
The maximum need of each process and current allocation are given below :

With reference to current allocation, is system safe ? If so, what is the safe sequence ?
- A.
No
- B.
Yes, P1P2P3P4
- C.
Yes, P4P3P1P2
- D.
Yes, P2P1P3P4
Attempted by 121 students.
Show answer & explanation
Correct answer: C
Step 1: Compute available resources. Total R = 12, allocated = 3 + 4 + 2 + 1 = 10, so available = 2.
Step 2: Compute remaining need for each process.
P1: need = 8 − 3 = 5
P2: need = 9 − 4 = 5
P3: need = 5 − 2 = 3
P4: need = 3 − 1 = 2
Step 3: Find a safe sequence using the Banker's algorithm.
Available = 2. P4's need = 2 ≤ available, so run P4 and release its allocation 1 → new available = 3.
Available = 3. P3's need = 3 ≤ available, so run P3 and release its allocation 2 → new available = 5.
Available = 5. P1's need = 5 ≤ available, so run P1 and release its allocation 3 → new available = 8.
Available = 8. P2's need = 5 ≤ available, so run P2 and release its allocation 4 → new available = 12.
Conclusion: The system is safe. One safe sequence is P4 → P3 → P1 → P2.
A video solution is available for this question — log in and enroll to watch it.