Question: An operating system uses the Bankers algorithm for deadlock avoidance when managing the allocation of four resource types A, B, C and D to five

An operating system uses the Bankers algorithm for deadlock avoidance when managing the allocation of four resource types A, B, C and D to five processes P1, P2, P3, P4 and P5. Resource type A has 7 instances, B has 4 instances, type C has 3 instances and type D has 2 instances. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

Available

Allocation

Max

Processes

D

C

B

A

D

C

B

A

D

C

B

A

1

1

1

1

1

0

1

0

2

2

3

2

P1

0

0

1

1

2

2

2

2

P2

1

1

0

3

1

1

1

4

P3

0

0

1

0

2

0

2

0

P4

0

1

1

2

0

1

2

4

P5

Answer the following questions considering the above case study:

1. What will be the output of the Need matrix in case of implementing the Banker algorithm?

2. Apply the Safety algorithm on the given case study and provide the results as safe or unsafe state.

3. Consider the following independent requests for additional resources in the current state:

REQ1: P1 requests 1 units of A, 0 units of B, 1 units of C and 0 units of D

REQ2: P2 requests 0 units of A, 0 units of B, 1 units of C and 0 units of D

Discuss the safe state of the system in case of serving REQ1 and REQ2, independently.

4. Draw the resource- allocation graph for the given system by critically analyzing the above table.

5. Develop a program to avoid the deadlock in the given system using Bankers Algorithm.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!