Deadlock-avoidance approach

Q. What is a safe state ?

Resource-Allocation-Graph Algorithm - Deadlock-avoidance approach

For the Figure 2 will deadlocks occur ?

Banker's Algorithm - Deadlock-avoidance approach

Q. Data Structures needed for the bankers algorithm ?

Q. Present the algorithm for finding out whether or not a system is in a safe state

  1. Let Work and Finish be vectors of length "m" and "n", respectively. Initialize Work = Available and Finish[i] = false for i = 0, 1, ... , n - 1.

  2. Find an index "i" such that both
  3. Work = Work + Allocation;
    Finish[i] = true 
    Go to step 2.
  4. If Finish[i] == true for all i, then the system is in a safe state

  5. This algorithm may require an order of m x n2 operations to determine whether a state is safe.

Q. Describe the algorithm for determining whether requests can be safely granted.

Illustrate the use of the Banker's Algorithm

Deadlock Detection - Wait for Graph

Recovery from Deadlocks

Previous Next