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...
Deadlock Avoidance using Banker’s Algorithm Q2: Use the following information and complete the Table, also write...
Deadlock Avoidance using Banker’s Algorithm Q2: Use the following information and complete the Table, also write down the safe sequence if exist? Three Resources (R1=4, R2=9, R3=11) Processes Allocated Resources R1   R2    R3 Maximum Required Resources R1   R2    R3 Currently Available Resources R1   R2    R3 Remaining Need R1   R2    R3 Safe Sequence P1 1      4      2 2      4      6 P2 2      1      1 3      2      8 P3 0      0      1 1      2      3 P4 0      0      0 4      4      2...
Consider the following hypothesis test. H0: μ = 100 Ha: μ ≠ 100 A sample of 65 is used. Identify the p-value and state your conclusion for each of the following sample results
  Consider the following hypothesis test. H0: μ = 100 Ha: μ ≠ 100 A sample of 65 is used. Identify the p-value and state your conclusion for each of the following sample results. Use α = 0.05. (a) x = 104 and s = 11.5 Find the value of the test statistic. (Round your answer to three decimal places.) Find the p-value. (Round your answer to four decimal places.) State your conclusion. Do not reject H0. There is sufficient...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT