0 votes 0 votes Operating System tancet + – Balaji Jegan asked Oct 23, 2018 retagged Oct 23, 2018 by Balaji Jegan Balaji Jegan 186 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Hemanth_13 commented Oct 23, 2018 reply Follow Share 2. Its unsafe state i guess, because haven't got into deadlock yet. 0 votes 0 votes MiNiPanda commented Oct 23, 2018 reply Follow Share Process Max Need Current Allocation Need Available=Total-∑(Current Allocation) P1 10 5 5 12-(10)=2 P2 4 2 2 P3 9 3 6 P2's need can be satisfied by the available resources. After P2 finishes it will release all its resources that it previously held. Now available will be 2+2=4. With these 4 resources neither of P1 nor P2's Need can be satisfied. This system will be in unsafe state. Why not deadlock? To answer that first we should know what actually does Max Need mean. It is the maximum no. of resources that a process might need. It doesn't mean that the process will need all those "max need" no. of resources for all the time. Maybe process P0 currently needs only 5 resources and doesn't want another 5 at this moment. Just think that if all the processes needed their respective Max need resources to complete execution at t1 then why is the OS not allocating all the 4 instances to P2 only or 10 resources to P1 or 9 resources to P3 at once? Why is it allocating in parts? This is because the processes have requested for resources in that manner. This implies that the processes do not need the max no. of resources at all instances. Had that been the case then it would lead to deadlock. Here a situation might arise when P1 and P3 request for 5 and 6 resources respectively. In that case deadlock will arise. But we cannot guarantee that they will surely make such requests. It is one of the possibilities. It might also happen that P3 releases some resources after some time. Then those can be allocated to P3 if it requests. Since there is always a chance of deadlock we say that it is unsafe. If we had been sure that deadlock will definitely occur then answer would have been C). My understandings are based on : https://cs.stackexchange.com/questions/55432/confusion-in-bankers-algorithm-how-resources-are-allocated https://cs.stackexchange.com/questions/45145/why-unsafe-state-not-always-cause-deadlock 0 votes 0 votes Please log in or register to add a comment.