The following system has 12 DVD drives and each process decl
The following system has 12 DVD drives and each process declares its maximum needs. In addition,
the current needs (DVD drives) that each process is holding is listed.
What is a safe sequence for this system? Prove it.
| Process | Maximum Needs | Current Needs |
| P0 | 6 | 2 |
| P1 | 7 | 2 |
| P2 | 4 | 2 |
| P3 | 2 | 1 |
| P4 | 11 | 3 |
Solution
Total DVD drives 12.
Total Current needs 10.
Remaining 2.
P3 has still 1 more need we give it to it and all P3 drives will be removed. So, P3 is first.
Now Total Remaining 4.
Next P2 maximum need is 4 and still remaining is 2, therefore P2 is assigned and released. Next P2.
Now total remaining is 8.
Next P0/P1. lets take P0. Therefore now total remaining is 14.
Next either P1/ P4. Lets take P1. Now total remaining is 21.
Last P4.
So, total safe sequence is P3,P2,P0,P1,P4
