An operating system has 13 tape drives. There are three processes P1, P2 & P3. Maximum requirement of P1 is 11 tape drives, P2 is 5 tape drives and P3 is 8 tape drives. Currently, P1 is allocated 6 tape drives, P2 is allocated 3 tape drives and P3 is allocated 2 tape drives. Which of the following sequences represent a safe state ?
(A) P2 P1 P3
(B) P2 P3 P1
(C) P1 P2 P3
(D) P1 P3 P2
Answer: (A)
Explanation: Maximum need for the process P1 P2 P3 is 11, 5, 8 and current allocation is 6, 3, 2 respectively. Total 13 tape drive were present out of which 11 are allocated and left with 2 drives.
Now P1 needs 5; P2 needs 2; P3 needs 6 tape Only P2’s need can be fulfilled. Now after P2 execute 5 tapes are free which can fulfill P1’s demand after that p1 will execute.
Execution order will be P2 P1 P3.
So, option (A) is correct.
Quiz of this Question
UGC-NET | UGC NET CS 2014 Dec – III | Question 52
Article Tags :
Recommended Articles