Question

Q1. Solve the following problem of Deadlock avoidance. Allocate the resources such that all the process...

Q1. Solve the following problem of Deadlock avoidance. Allocate the resources such that all the process are executed safe and no deadlock is occur.

Total instances of a resource=10

Process

Has

Maximum

P1

2

4

P2

2

7

P3

3

9

Free

Homework Answers

Answer #1

Solution:

Given data

Process Has Maximum Needed Remaining Needs After Allocation
P1 2 4 4-2=2
P2 2 7 7-2=5
P3 3 9 9-3=6

Here we know that total number of resources available are 10

So Total number of resources which are free = total resources - sum(allocated resources)

i.e Available resources = 10 - (2+2+3) = 3

Available Resources
3

Here available resources are 3.

For avoiding deadlock we need to allocate the resources whose needs are meeting with the available resources.

So from the given processes P1 requires 2 resources,P2 requires 5 resources where as P3 requires 6 resources.

Here available resources are 3 so we can allot the 2 resources needed for process P1.

i.e

Available Resources after alloting to process P1
3-2=1

Now assume process p1 has completed that means it will relase all its resouces i.e 4 will be added to available resources.

Available Resources after completion of P1
Prev Available + P1 releases resources = 1 + 4 = 5

Now we have available resources as 5. Since P1 is completed the remaining processes are P2,P3 which requires 5 and 6 resources to complete the execution.

Here process P2 requires 5 resources and the available resources also 5 so we can allot those resources to process P2.

i.e

Available Resources after alloting to process P2
5 - 5 = 0

Now P2 has all needed resources so it will complete its execution and will release the resources it has i.e 7.

Available Resources after completion of P2
Prev Available + P2 releases resources = 0 + 7 = 7

Till now P1,P2 are executed safely without any deadlock.

Now the final remaining process is P3 which requires 6 more resources to execute . Here available resources are 7 so assign 6 resources to process P3.

Available Resources after alloting to process P3
7 - 6 =1

Since all needed resources allocated P3 will completer its execution and releases the resources.

Available Resources after completion of P3
Prev Available + P3 releases resources = 1 + 9 = 10

Final Available resources after completion of all processes should equal to total instance of resources i.e 10

Available Resources after completion of All processes
10

Here P1,P2,P3 executed without any deadlock. So the system is in safe state and the safe sequence is P1,P2,P3.

Note: if you have any queries please post a comment thanks a lot... always available to help you....

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Q1. Solve the following problem of Deadlock avoidance. Allocate the resources such that all the process...
Q1. Solve the following problem of Deadlock avoidance. Allocate the resources such that all the process are executed safe and no deadlock is occur. Total instances of a resource=12 Process Has Maximum P1 5 10 P2 2 4 P3 2 9 Free
Efficient Allocations for Depletable Resources n = 2 time periods. Inverse Demand Curves: P1 = 10...
Efficient Allocations for Depletable Resources n = 2 time periods. Inverse Demand Curves: P1 = 10 - 0.4q1 for period 1 and P2 = 10 - 0.4q2 for period 2. Marginal Costs for the two periods:   MC1 = $3.00   MC2 = $3.00 Discount rate = 15% Resource Availability Constraint:   Q = q1 + q2 = 25 billion units. Calculate the dynamically efficient allocations q1* and q2* for periods 1 and 2. Dynamic efficiency condition MNB1 = λ = PV MNB2...
Answer Questions 2 and 3 based on the following LP problem. Let     P1 = number of...
Answer Questions 2 and 3 based on the following LP problem. Let     P1 = number of Product 1 to be produced           P2 = number of Product 2 to be produced           P3 = number of Product 3 to be produced Maximize 100P1 + 120P2 + 90P3         Total profit Subject to         8P1 + 12P2 + 10P3 ≤ 7280       Production budget constraint             4P1 + 3P2 + 2P3 ≤ 1920       Labor hours constraint                                    P1 > 200         Minimum quantity needed...
Be appreciated if you can solve this problem to me. Following are the number of years...
Be appreciated if you can solve this problem to me. Following are the number of years of service for 40 employees in a company. The CEO wants to pick a sample of 10 to determine the average number of year of service. Using the systematic random sampling pick out the sample of 10 starting with any point from the first column. 11 4 18 2 1 2 0 2 2 4 3 4 1 2 2 3 3 19 8...
Four Step Process with Rework and Scrap Consider the following four step assembly operation with quality...
Four Step Process with Rework and Scrap Consider the following four step assembly operation with quality problems. All resources are staffed with one operator. -The first resource has a processing time of 4 minutes per unit -The second resource has a processing time of 3 minutes per unit. This process suffers from a high yield loss and 50% of all products have to be scrapped after this step. -The third resource also suffers from quality problems. However, instead of scrapping...
utility function u(x,y) = x3 ·y2 I am going to walk you through the process of...
utility function u(x,y) = x3 ·y2 I am going to walk you through the process of deriving the optimal quantity of apples and bananas that will make you the happiest. To do this, we are going to apply what we learnt about derivatives. a) First, you have a budget. You cannot just buy an infinite amount since you would not be able to afford it. Suppose the price of a single apple is Px = 2 while the price of...
The following table shows​ William's total utility from consuming Pita Wraps and Bubble Tea. Pita Wraps...
The following table shows​ William's total utility from consuming Pita Wraps and Bubble Tea. Pita Wraps Bubble Tea Quantity Total Utility 1 72 2 156 3 222 4 276 5 318 6 354 7 378 8 396 9 405 10 411 11 414 12 414 Quantity Total Utility 1 60 2 126 3 180 4 230 5 276 6 318 7 354 8 372 9 381 10 387 11 390 12 390 Suppose William has​ $30 to spend on Pita...
Students should select one problem and solve. Post should include a detailed solution and explanation. 1....
Students should select one problem and solve. Post should include a detailed solution and explanation. 1. A random sample of 56 fluorescent light bulbs has a mean life of 645 hours. Assume the population standard deviation is 31 hours. Construct a 95% confidence interval for the population mean. 2. The standard IQ test has a mean of 96 and a standard deviation of 14. We want to be 99% certain that we are within 4 IQ points of the true...
Solve the following problem. Especially Stuck on 11 Asset Turnover,12 Return on total asset and 13...
Solve the following problem. Especially Stuck on 11 Asset Turnover,12 Return on total asset and 13 Return on stockholders equity Determine the following measures for 20Y2 (round to one decimal place, including percentages, except for per-share amounts): 1. Working Capital $ 2. Current ratio 3. Quick ratio 4. Accounts receivable turnover 5. Number of days' sales in receivables 6. Inventory turnover 7. Number of days’ sales in inventory 8. Ratio of fixed assets to long-term liabilities 9. Ratio of liabilities...
Problem 1 ...... you can use Matlan i got one so all what i need is...
Problem 1 ...... you can use Matlan i got one so all what i need is 2, 3 and 4 one of them or all of them .. thanks The following Scilab code generates a 10-second “chirp” with discrete frequencies ranging from 0 to 0.2 with a sampling frequency of 8 kHz. clear; Fs = 8000; Nbits = 16; tMax = 10; N = Fs*tMax+1; f = linspace(0.0,0.2,N); x = zeros(f); phi = 0; for n=0:N-1 x(n+1) = 0.8*sin(phi); phi...