Question

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.

Deadlocks. The Banker's algorithm is used for deadlock avoidance. Consider the state of resource availability and allocation defined by the following matrices.

image.png

(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?

Solutions

Expert Solution

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:

and .

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.


Related Solutions

Implement the Banker's algorithm for deadlock avoidance, that works on a given set of N processes...
Implement the Banker's algorithm for deadlock avoidance, that works on a given set of N processes and M resource types (N<10,M<10). Use C/C++/C# or Java for the implementation, with a simple text interface, where the user enters only the name of the input file (text only). The program reads all the necessary input data from that file. The input data and result is then displayed on the screen. You may use your program to validate the example you gave in...
Consider the bankers algorithm for deadlock avoidance. Give an example of this algorithm for 7 processes...
Consider the bankers algorithm for deadlock avoidance. Give an example of this algorithm for 7 processes and 5 resource types.
Given the following state for the Banker's Algorithm
Given the following state for the Banker's Algorithm 5 processes PO through P4 3 resource types before assigning to any process. A has 5 instances: B has 6 Instances. C has 8 instances and D has 4.Allocation: the resources currently assigned to each process Max Claim: The maximum number of resource instances a process will need in order to complete. Determine the available vector
1- Consider the following resource allocation graph and check whether it contains deadlock or not? Justify...
1- Consider the following resource allocation graph and check whether it contains deadlock or not? Justify your answer in detail. 2- Consider the following page reference string: 4, 6, 7, 8, 6, 7, 8, 4, 6, 4, 4, 7, 5, 8 Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms? illustrate your work. FIFO replacement. LRU replacement. 3- What is swapping? explain the terms "swap in" and "swap out" with a neat...
Implement a C++ program to implement the Banker’s algorithm for deadlock avoidance. Number of process 5,...
Implement a C++ program to implement the Banker’s algorithm for deadlock avoidance. Number of process 5, number of resources 3 and the number of instances of each given resource is in available. You should complete the functionalities for safe state check and resource request processing. To Do 1. Complete the definition of isSafe function. The function take, the process array, 1D array of available resources, 2D array storing current allocation, and 2D array of current need. The function does not...
Discuss the difference between deadlock avoidance, detection, and prevention approaches with examples of algorithms being used...
Discuss the difference between deadlock avoidance, detection, and prevention approaches with examples of algorithms being used in each case.
Deadlock –Banker’s Algorithm A system has three resource types (A, B, C) and four processes {P1,...
Deadlock –Banker’s Algorithm A system has three resource types (A, B, C) and four processes {P1, P2, P3, P4 }. The total units of system resources are: (8, 5, 4) units of A, B and C, respectively. The maximum demands for each process is P1(1,2,3), P2(3,2,1), P3(6,5,4) and P4(4,4,2). The current allocation is: P1(0,1,1), P2(2,2,0) and P3(3,0,1) and P4(1,0,1). (a) Allocation table is given for the 3 processes with the following four columns: PROCESS, ALLOCATION, MAX and NEED. And fill...
Given the following project: Develop a time limited resource profile chart assuming unlimited resource availability. That...
Given the following project: Develop a time limited resource profile chart assuming unlimited resource availability. That is, determine the resource requirement on a weekly basis if the project is to be completed in the minimum time. Develop a resource-constrained schedule using the sequential heuristic. Activity Predecessor Duration (week) Required No. of Workers 1 - 3 2 2 - 2 1 3 2 3 2 4 2,5 4 2 5 1 4 1 6 3,4,1 3 1 7 3 4 2...
. State and expatiate on any four measures used to determine the availability of stock resources...
. State and expatiate on any four measures used to determine the availability of stock resources and indicate the importance of these measures in Resource Assessment
Which of the following best describes a strategy? It is a comprehensive plan guiding resource allocation...
Which of the following best describes a strategy? It is a comprehensive plan guiding resource allocation to achieve long-term organization goals. It is the same as the mission of the organization. It is the document expressing the organization's reason for existence in society. It is the predominant value system of the organization as a whole. It is a special strength that gives an organization a competitive advantage.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT