Question

In: Computer Science

Consider the following snapshot of a system that has four resource types: A, B, C, and...

Consider the following snapshot of a system that has four resource types: A, B,
C, and D and five processes, P0, P1, P2, P3, and P4.


Allocation Max
A B C D A B C D
P0 3 0 1 5 5 1 1 7
P1 2 2 1 0 3 2 1 1
P2 3 1 2 1 3 3 2 1
P3 0 5 1 0 4 6 1 2
P4 4 2 1 3 6 3 2 5

Consider the situation in which Available = (0, 2, 1, 2). Give an example of a request
from P0 that can be served from the available resources, does not violate the maximum resources declared by the process but causes the system to be in a non-safe state as defined by the banker’s algorithm. Show all work (how the Available array changes after each step of the algorithm).

Solutions

Expert Solution

Greetings!!

At present, the allocation,max,need and available resouces are as shown below:

  • At this state, the available resouces are 0,2,1,2 and the Need of P2 can be satisfied because Need<=Available

ie 0,2,0,0 <= 0,2,1,2

  • Then process P2 continues and after the execution it releases all the resources which were allocated to it. ie 3,1,2,1 are added back to the Available as shown in red colour.

  • With the Available resources of 3,3,3,3 process P0 can start execution. After the execution of P0,3,0,1,5 resources will be added back to the Available

Now P1 can proceed followed by P3 and P4

Hence all the processes completed their execution and the system is in safe state and the safe sequence is P2,P0,P1,P3 and P4.

No other request only by P0 will not make the system unsafe state. If more than one process change their request an unsafe state can occur.

Hope this helps


Related Solutions

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...
Consider the following snapshot of a system:
Consider the following snapshot of a system:           Allocation       Max          Available             ABCD         ABCD           ABCDT0        3141           6473            2224T1        2102           4232 T2        2413           2533 T3        4110           6332T4       ...
Consider a project consisting of four activities A, B, C, and D. The following are constraints...
Consider a project consisting of four activities A, B, C, and D. The following are constraints within which the project has to be conducted • A and B, the first activities of the project, can be started simultaneously. • C can be started only after A is completed. • D can be started only after B is completed Suppose the activity times for the activities are A = 4 weeks, B = 3 weeks, C = 2 weeks, D =...
Consider an experiment with four independent variables: A, B, C, and D. Factor A has 3...
Consider an experiment with four independent variables: A, B, C, and D. Factor A has 3 levels and is a between-subjects variable; Factor B has 2 levels and is a within-subjects variable; Factor C has 2 levels and is a between-subjects variable; Factor D has 3 levels and is a within-subjects variable. 1. How many “cells” or “conditions” or “groups” are there in this experiment? 2. If you want to test 10 participants per cell, how many TOTAL participants will...
QUESTION 2 Consider the following four--?step assembly operation with quality problems. -The first resource has a...
QUESTION 2 Consider the following four--?step assembly operation with quality problems. -The first resource has a processing time of 7 minutes per unit and one employee doing the operation ? The second resource has a processing time of 4 minutes per unit.  It also has one employee doing the operation. However, this is a very delicate task and 0.79 of all products have to be scrapped after this step. ? Two workers are staffed for the third resource. No quality problems...
Consider the following four--?step assembly operation with quality problems. -The first resource has a processing time...
Consider the following four--?step assembly operation with quality problems. -The first resource has a processing time of 7 minutes per unit and one employee doing the operation ? The second resource has a processing time of 4 minutes per unit. It also has one employee doing the operation. However, this is a very delicate task and 0.79 of all products have to be scrapped after this step. ? Two workers are staffed for the third resource. No quality problems occur...
Consider the following four--‐step assembly operation with quality problems. -The first resource has a processing time o...
Consider the following four--‐step assembly operation with quality problems. -The first resource has a processing time of 5 minutes per unit and one employee doing the operation ‐ The second resource has a processing time of 4 minutes per unit. It also has one employee doing the operation. However, this is a very delicate task and 0.85 of all products have to be scrapped after this step. ‐ Two workers are staffed for the third resource. No quality problems occur...
The following graph contains four lines (A, B, C and D), each of which has a...
The following graph contains four lines (A, B, C and D), each of which has a slope that is either positive, negative, zero, or infinite.For each of the following scenarios, indicate whether the relationship between the two variables is positive or negative, as well as which line on the previous graph has a slope that reflects this type of relationship. Hint: The X-axis and Y-axis on the graph are not labeled intentionally. You need to substitute the variables from each scenario...
The following graph contains four lines (A, B, C and D), each of which has a...
The following graph contains four lines (A, B, C and D), each of which has a slope that is either positive, negative, zero, or infinite.For each of the following scenarios, indicate whether the relationship between the two variables is positive or negative, as well as which line on the previous graph has a slope that reflects this type of relationship. Hint: The X-axis and Y-axis on the graph are not labeled intentionally. You need to substitute the variables from each scenario...
We consider a GSP auction with four bidders, A, B, C and D. Since there are...
We consider a GSP auction with four bidders, A, B, C and D. Since there are four bidders only the three highest bidders will be displayed). The click frequency of the first, second and third positions are 100 clicks/hour, 75 clicks/hour and 35 clicks/hour, respectively. Bidders’valuation per click are vA = 10, vB = 6, vC = 4, vD = 3. Bidder B, C and D bid 5, 3 and 1, respectively. What is the optimal bid for A?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT