Question

Deadlock Avoidance using Banker’s Algorithm Q1: Use the following information and complete the Table, also write...

Deadlock Avoidance using Banker’s Algorithm

Q1: 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


Homework Answers

Answer #1

Equations involved in bankers algorithm are

Need Matrix = max resources - allocated resources

Available Resources = Total resources - sum of allocated resources for each process.

If need <=available Resources , then process can be executed . After execution allocated resources are added to available Resources.

Max Matrix

Process R1 R2 R3
P1 1 0 4
P2 1 1 7
P3 1 2 2
P4 4 4 2

Available Resources.

R1 = 4-(1+2)= 1

R2=9-(4+1)=4

R3=11-(2+1+1)=7

Checking availability for P1,

1,0,4 <= 1,4,7

So P1 executes, after completion

Available Resources = 2,8,9

Checking availability for P2,

1,1,7<=2,8,9

P2 executes,

After execution available Resources = 4,9,10

Checking availability for P3,

1,2,2 <= 4,9,10

P3 executes,

After execution, available Resources = 4,9,11

Checking availability for P4,

4,4,2 <= 4,9,11

P4 executes.

Safe cycle = P1,P2,P3,p4

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
What is deadlock? Draw a resource allocation graph for the following processes and resources. There are...
What is deadlock? Draw a resource allocation graph for the following processes and resources. There are four processes running (P1, P2, P3 and P4) and five resources each with single instance (R1, R2, R3, R4 and R5). P1 is holding R1 and R3 and requesting R2. P2 is holding R2 and requesting R3. P3 is holding R4 and requesting R5. P4 is holing R5 and requesting R1. Is it a deadlock situation? Justify your answer.
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
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
Consider a system with eight resources currently allocated as follows: Resource Allocated to Process R1 P4...
Consider a system with eight resources currently allocated as follows: Resource Allocated to Process R1 P4 R2 P1 R3 P5 R4 P7 R5 P2 R6 P8 R7 P3 R8 P6 The following sequence of additional resource requests is then processed. (Let REQ(A,B) denote process A's request for resource B.) REQ(P4, R2) REQ(P3, R6) REQ(P2, R1) REQ(P7, R7) REQ(P6, R1) REQ(P5, R7) The above sequence of requests do not cause a deadlock. Verify this fact by constructing a resource-allocation graph involving...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process            Burst Time Priority P1                               5 4 P2                               3 1 P3                               1 2 P4                               7 2 P5                               4 3 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. If nonpreemptive priority (a larger priority number implies a higher priority) is used, what is the average waiting time of...
The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is...
The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is assigned a numerical priority,with a higher number indicating a higher relative priority. The scheduler will execute the highest-priority process. For processes with the same priority, a round-robin scheduler will be used with a time quantum of 10 units. If a process is preempted by a higher-priority process, the preempted process is placed at the end of the queue. Process            Burst Time Arrival Time...
The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is...
The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is assigned a numerical priority,with a higher number indicating a higher relative priority. The scheduler will execute the highest-priority process. For processes with the same priority, a round-robin scheduler will be used with a time quantum of 10 units. If a process is preempted by a higher-priority process, the preempted process is placed at the end of the queue. Process            Burst Time Arrival Time...
Using the non-preemptive and preemptive Priority schedulers, draw out process execution timelines for the following processes....
Using the non-preemptive and preemptive Priority schedulers, draw out process execution timelines for the following processes. Clearly indicate the wait time for each process for each scheduler.   Process Arrival Burst Priority P1 0 6 2 P2 3 2 1 P3 6 8 4 P4 9 4 5 P5 12 3 3
Using the information below answer the following questions. (Use the Midpoint (Arc) method) If Qd =...
Using the information below answer the following questions. (Use the Midpoint (Arc) method) If Qd = 750 - 30 P and Qs = 0 + 40 P Where: Qd = Quantity of the good demanded Qs = Quantity of the good supplied (Note: Be sure to include the negative sign in your answer if appropriate) Part 1: The Equilibrium Price is: Part 2: The Equilibrium Quantity is: Part 3: Price elasticity of demand between P1= 12.21 and P2= 9.21 is:...
Use Python to Complete the following on a single text file and submit your code and...
Use Python to Complete the following on a single text file and submit your code and your output as separate documents. For each problem create the necessary list objects and write code to perform the following examples: Sum all the items in a list. Multiply all the items in a list. Get the largest number from a list. Get the smallest number from a list. Remove duplicates from a list. Check a list is empty or not. Clone or copy...