In: Other
Deadlocks. The Banker's algorithm is used for deadlock avoidance. Consider the state of resource availability and allocation defined by the following matrices.
(1) Assuming that the total amounts for resources R1, R2, and R3 are 10, 2, and 10, should a new request to the Banker's algorithm by process P3 to acquire one additional resource from R1 and one additional resource from R3 be approved or denied? Explain why or why not
(2) Assuming that the total amounts for resources R1, R2, and R3 are 10, 2, and 10, should a new request to the Banker's algorithm by process P4 to acquire one additional resource from R3 be approved or denied? Explain why or why not.
(3) Assuming that the total amounts for resources R1 and R2 are 10 and 2, what is the minimum amount for resource R3 that would render the above state a safe state under the Banker's algorithm? P3, and P4 to complete their execution subject to the Banker's algorithm amount for resource R3 that would make it possible for the Banker's algorithm to allow process
(4) Given your answer for part (3) what are all the possible orderings for the four processes P1, P2,
(5) Assuming that the total amounts for resources R1 and R2 are 10 and 2, what is the minimum P1 to complete its execution before all other three processes?
2. If P4 requires one more from R3 then it's max need will be <4 2 3>, and it's allocated with <0 0 2> then need is <4 0 1>.
Similarly like 1, here we would have <10 2 8> resources when we come to P4, so it can be granted.
3. If the total amount of resources of R1 , R2 is 10 ,2 respectively.
Then 7 resources of R3 required for safe state in Bannker's algorithm.
Because, as total number of allocated for R3 is 5 and minimum need is 2, so most with 6 number of resources will cause deadlock and with 7 number of instances of R3 will be safe state.
4. Now, using Banker's algorithm like question 1, we will find following possible orderings for Banker's algorithm:
5. Assuming amount of resources of for R1,R2 is 10,2.
Then amount of resources required to execute P1 complete first is:8.
Because, total number of allocated amount for R3 is 5 and need for P1 is 3.