In the Banker's algorithm, what does it mean for the system to be in a safe state?
Think about what the algorithm tries to ensure before granting resource requests.
A safe state means the system can allocate resources to each process in some order and avoid deadlock. It does not mean no requests or all resources are allocated.
Which of the following is not a key data structure used in the Banker's algorithm?
Recall the matrices and vectors used to track resource allocation and needs.
The Banker's algorithm uses Available, Allocation, Maximum, and Need matrices/vectors. It does not use a request queue to order waiting processes.
Given the following state:
Available = [3, 2, 2] Allocation = [[0, 1, 0], [2, 0, 0], [3, 0, 2], [2, 1, 1], [0, 0, 2]] Maximum = [[7, 5, 3], [3, 2, 2], [9, 0, 2], [2, 2, 2], [4, 3, 3]]
If process P1 requests [1, 0, 2], will granting this request keep the system in a safe state?
Check if the request is within maximum demand and available resources, then verify if a safe sequence exists after allocation.
The request by P1 is within its maximum demand and available resources. After hypothetically granting it, the system can find a safe sequence, so it remains safe.
Which statement best distinguishes deadlock avoidance (like Banker's algorithm) from deadlock prevention?
Think about how each approach handles resource requests and system state.
Deadlock avoidance algorithms like Banker's check if granting a request keeps the system safe before allocation. Prevention methods restrict resource usage to avoid unsafe states.
Which of the following is a fundamental limitation of the Banker's algorithm in practical operating systems?
Consider what information the algorithm needs to function correctly.
The Banker's algorithm needs each process to declare its maximum resource needs beforehand, which is difficult in real systems where needs may be unknown or change.