Question

In: Computer Science

Consider a system consisting of 4 resources of the same type that are shared among 3 processes, each of which needs at most 2 resources.

Consider a system consisting of 4 resources of the same type that are shared among 3 processes, each of which needs at most 2 resources. Show that the system is deadlock-free. Hint: Show that the condition ((claim-allocated) <= available) can always be satisfied.

Solutions

Expert Solution

Lets us consider the processes are P1,P2,P3.

Here the resources are of same type and there are 4 resources available

We will give one resource to each process initially

Now,1 resource is available

Inorder to any process to complete its execution they need atmost two resources

therefore we give the additional remaining 1 resource to the process P1.

Here ((claim-allocated)<=allocated) =((1-1)<=0) is satisfied

Now after the process P1 execution gets completed it will releases the resources with it

Now available=2, P2 will starts and ((claim-allocated)<=allocated) =((1-1)<=2) is satisfied

Now after the process P2 execution gets completed it will also releases the resources with it

Now available=3, P3 will starts and ((claim-allocated)<=allocated) =((1-1)<=3) is satisfied

And P3 will completes its execution

Here we can conclude that the system is in safe state and there is no deadlock


Related Solutions

Which three processes lead to variation among offspring that have the same two parents?
Which three processes lead to variation among offspring that have the same two parents? a) genetic recombination, fertilization, meiosis b) crossing over, random chromosome assortment, genetic recombination c) meiosis, crossing over, genetic recombination  d) fertilization, crossing over, random chromosome assortment
Problem 4 [25 pts]. (It is the same physical system as in the Problem 3) A...
Problem 4 [25 pts]. (It is the same physical system as in the Problem 3) A hoop of mass M=400.g and radius R=20.0 cm is rolling without slipping in clockwise direction down an incline plane with the incline angle ? = 20? . 1. How much work is done by frictional force acting on the hoop on (1) translation, (2) rotation of the hoop? Show all work so that your final answer is justified. 2. How much is ???ℎ?? on...
Question 156 Which of the following is not among the 4 most commonly mutated genes in...
Question 156 Which of the following is not among the 4 most commonly mutated genes in pancreatic cancer? KRAS p16 gene TGFb eta SMAD4 Question 164 Pancreatic Ductal Adenocarcinoma (PDAC) tumors typically arise from (choose all that apply): tumorigenic pancreatic stellate cells neoplasms derived from ductal cells neuroendocrine cells grade 3 intraepithelial neoplasms Question 170 A drug that inhibits the interaction between PD and PDL-1 would be classified as a(n) NSAID checkpoint inhibitor adoptive cell transfer inhibitor cytokine-mediated chemotherapeutic agent...
8a) In Windows system programming, many system resources are represented as kernel objects, each of which...
8a) In Windows system programming, many system resources are represented as kernel objects, each of which is represented as a handle. Discuss with 3 examples how the system programmer can manipulate these handle objects. AP, 8 b) Write a C/C++ system program to move a file from one folder to another in the Windows file system. Compile and run the program and copy the source code into your answer booklet. CR,10 c) Compare and contrast processes and threads and discuss...
Problem 2.2 Consider a production system consisting of three Bernoulli machines and a controller, which also...
Problem 2.2 Consider a production system consisting of three Bernoulli machines and a controller, which also obeys the Bernoulli reliability model. This production system is considered up if the controller and at least two machines are up. During each cycle, the controller is up with probability 0.8 and each machine is up with probability 0.9. The controller and the machines fail independently. (a) Calculate the probability that the production system is up. (b) Assume that a second controller, identical to...
Consider a system which has to accept prefix arithmetic expressions consisting of ‘+’(binary addition) , ‘-‘(binary...
Consider a system which has to accept prefix arithmetic expressions consisting of ‘+’(binary addition) , ‘-‘(binary subtraction), ‘*’(multiplication), ‘~’(unary subtraction), single digit numbers and compute their value. Examples: +12 → 3 ++12 → fail +*123 → 5 *+123 → 9 +123 → fail What parts would be required for such a system? How do these parts relate to the concepts studied? Could you write a program to implement such a system? (Layout of the structure and the logic of the...
2. Consider functions f : {1, 2, 3, 4, 5, 6} → {1, 2, 3, 4,...
2. Consider functions f : {1, 2, 3, 4, 5, 6} → {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. (a) How many of these functions are strictly increasing (i.e. f(1) < f(2) < f(3) < f(4) < f(5) < f(6))? Hint: How many different possibilities are there for the range of f? For each range of f, how many strictly increasing functions are there? (b) How many of these functions are non-decreasing (i.e. f(1) ≤ f(2) ≤...
Consider the system of linear equations: 3? − 5? + 2? = 2 2? − ?...
Consider the system of linear equations: 3? − 5? + 2? = 2 2? − ? + 3? = 3 ? + 4? + 7? = 4 (a) Write the augmented matrix for the above system. (b) Find the inverse of the coefficient matrix. (c) Find the determinant of the coefficient matrix. (d) Find the LU-factorization of the coefficient matrix. (e) Solve the above system using Gauss-Jordan elimination. (f) Use the inverse of the coefficient matrix from part (b) to...
Consider the system introduced in example 3.B.2 (p. 97) in which a 2 L sealed jar,...
Consider the system introduced in example 3.B.2 (p. 97) in which a 2 L sealed jar, half filled with water and half filled with air, contains 10-3 mol of toluene. The equilibrium partitioning is described by Henry's law, so that the aqueous phase contains 0.78 x 10-3 mol and the gas phase contains 0.22 x 10-3 mol. To this system 150 mg of activated carbon is added to absorb toluene. Toluene partitioning between the sorbed and aqueous phases is described...
2. Consider the following data: x= 1, 2, 3, 4, 5 y =3, 2, 4, 6,...
2. Consider the following data: x= 1, 2, 3, 4, 5 y =3, 2, 4, 6, 5 By hand, not using Matlab, and showing your work: (a) Compute the correlation coefficient. (b) Find the least-squares line. (c) Find the standard deviation around the least-squares line.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT