757 views
2 votes
2 votes
In a system which has only 3 processes, there are 2 copies of R1 resource, 3 copies of R2 resource. Say, in the current snapshot of the system, Process P1 holds 2 copies of resource R1 and needs 1 copy of R2 to complete its execution. P2 holds 2 copies of R2 and needs 2 copies of R1. P3 needs 2 copies of R1 and holds 1 copy of R2. At this moment, P1 gives up and releases the resource copies that it holds, only to request them again at a much later point in time. The probability that the system will be in a deadlock again is ____ (up to 2 decimal places).

1 Answer

Best answer
3 votes
3 votes

P1 holds 2 copies of R1. And P2 and P3 require 2 copies of R1 each. 


Now, allocation may happen in either of the following ways : 


1. P2 gets 1 copy of resource and P3 gets 1 copy of resource -- leads to deadlock
2. P2 gets both the resources -- deadlock-free
3. P3 gets both the resources -- deadlock-free


Therefore, 1 out of 3 possibilities leads to a deadlock. Therefore 1/3 = 0.33
 
selected by

Related questions

1 votes
1 votes
1 answer
2
LRU asked Nov 5, 2021
438 views
Given a system with 3 processes where each process requires at least 2 resources to complete their execution, then the largest number of resources which will guarantee a ...
2 votes
2 votes
2 answers
4
LRU asked Oct 10, 2021
744 views
Given 5 processes and R copies of total resources in a system, each process requires 7 copies of resources to complete its execution. The maximum value of R to have deadl...