Consider a system has 3 process P1,P2,P3. Process P1 needs 20 units of resources R, P2 needs 15 units of R and P3 needs 5 unit of R. What is the maximum unit of resource R that leads to deadlock?
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To determine the maximum units of resource R that can lead to a deadlock in a system with three processes P1, P2, and P3, where each process requires a specific number of resource units, we need to analyze the resource allocation and request patterns.
Given:
– Process P1 requires 20 units of resource R.
– Process P2 requires 15 units of resource R.
– Process P3 requires 5 units of resource R.
For a deadlock to occur, each process must hold some resources and be waiting for additional resources that another process holds. A deadlock is possible if the total units of the resource R in the system are less than the sum of the maximum needs of the processes minus the number of processes plus one.
The formula to determine the maximum units of resource R that can lead to deadlock is:
Total resources < sum (Max needs) – (Number of processes – 1)
Plugging in the values:
Total resources < (20 + 15 + 5) – (3 – 1)
Total resources < 40 – 2
Total resources < 38
Therefore, the maximum number of units of resource R that can lead to a deadlock in this system is 37. If the system has 37 or fewer units of resource R, it is possible for the processes to reach a state where they are all holding some resources and waiting for more, leading to a deadlock.
In summary, the maximum units of resource R that lead to a deadlock in this system are 37 units.