| Process | Allocation Time | Maximum Requirement |
|---|---|---|
| P1 | 3 | 7 |
| P2 | 1 | 6 |
| P3 | 3 | 5 |
Which of the following best describes the current state of the system?
Correct : D
Given:
Total number of tape drives = 9
Processes: P1, P2, P3
Allocation: P1 = 3, P2 = 1, P3 = 3
Max Requirement: P1 = 7, P2 = 6, P3 = 5
To find:
Whether the current state of the system is Safe/Not Safe and Deadlocked/Not Deadlocked.
Solution:
First, let me calculate the total allocated tape drives.
Total allocated = 3 + 1 + 3 = 7
Now let me find the currently available tape drives.
Available = Total - Total allocated = 9 - 7 = 2
Next, I need to calculate the remaining Need for each process using Need = Max - Allocation.
For P1: Need = 7 - 3 = 4
For P2: Need = 6 - 1 = 5
For P3: Need = 5 - 3 = 2
Now let me check which process can be satisfied with Available = 2.
Checking P1: Need(P1) = 4 > Available (2), so P1 cannot execute right now.
Checking P2: Need(P2) = 5 > Available (2), so P2 cannot execute right now.
Checking P3: Need(P3) = 2 β€ Available (2), so P3 can execute and complete.
Once P3 finishes, it releases its allocated tape drives.
New Available = 2 + Allocation of P3 = 2 + 3 = 5
Now check the remaining processes with Available = 5.
Checking P1: Need(P1) = 4 β€ Available (5), so P1 can run and complete.
Once P1 finishes, it releases its allocated drives.
New Available = 5 + Allocation of P1 = 5 + 3 = 8
Finally, check P2.
Need(P2) = 5 β€ Available (8), so P2 can also finish.
A safe sequence exists: <P3, P1, P2>.
Since a safe sequence exists, the system is in a Safe state.
By definition, if a system is in a safe state, it is definitely Not Deadlocked.
Answer:
(B) Safe, Not Deadlocked
Similar Questions
Total Unique Visitors