Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Quiz 3: Operating System
Problem: Banker's Algorithm for Deadlock Avoidance
A system has 5 processes (P0 to P4) and 3 resource types (A, B, C). The maximum demand of each process, the current allocation, and the available resources are as follows:
Maximum Resource Demand Matrix (Max)
Process A B C P0 7 5 3 P1 3 2 2 P2 9 0 2 P3 2 2 2 P4 4 3 3
Current Allocation Matrix (Allocation)
Process A B C P0 0 1 0 P1 2 0 0 P2 3 0 2 P3 2 1 1 P4 0 0 2
Available Resources Vector (Available)
A B C Available 3 3 2
Questions: 1. Calculate the Need matrix for each process.
2. Determine if the system is in a safe state using the Banker's Algorithm. If so, provide a safe sequence of processes.