0% found this document useful (0 votes)
7 views2 pages

Algorithm Corrected

The document analyzes a system's state using the Banker's Algorithm by evaluating the Max and Allocation matrices along with available resources. It concludes that no processes can proceed due to insufficient resources, indicating that the system is not in a safe state. Therefore, the final determination is that the system is NOT in a safe state.

Uploaded by

redragon165
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Algorithm Corrected

The document analyzes a system's state using the Banker's Algorithm by evaluating the Max and Allocation matrices along with available resources. It concludes that no processes can proceed due to insufficient resources, indicating that the system is not in a safe state. Therefore, the final determination is that the system is NOT in a safe state.

Uploaded by

redragon165
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Banker's Algorithm - Corrected Analysis

Given Question:

Determine if the system is in a safe state using the Banker's Algorithm.

Max Matrix:

P0: 0 0 1 3

P1: 1 7 6 0

P2: 2 4 5 6

P3: 0 6 5 2

P4: 0 8 5 6

Allocation Matrix:

P0: 0 0 1 2

P1: 1 0 0 0

P2: 1 4 5 4

P3: 0 6 3 0

P4: 0 0 1 4

Available Resources: A=1, B=5, C=2, D=0

Step 1: Need Matrix (Need = Max - Allocation)

Process ABCD

P0 0001

P1 0760

P2 1002

P3 0022
P4 0842

Step 2: Safe State Check

Initial Available = [1, 5, 2, 0]

Checking which processes can proceed:

- P0: Need [0, 0, 0, 1] --> D=1 > 0 --> Cannot proceed

- P1: Need [0, 7, 6, 0] --> B=7 > 5 --> Cannot proceed

- P2: Need [1, 0, 0, 2] --> D=2 > 0 --> Cannot proceed

- P3: Need [0, 0, 2, 2] --> D=2 > 0 --> Cannot proceed

- P4: Need [0, 8, 4, 2] --> B=8 > 5 --> Cannot proceed

No process can execute with the current Available resources.

Hence, the system is NOT in a safe state.

Conclusion:

The system is NOT in a safe state.

You might also like