In a concise presentation:

  1. Provide a concise review of Banker’s algorithm. What is the difference between the two scenarios: when this algorithm is applied to deadlock avoidance and when it is applied to deadlock detection?

  2. Show step-by-step how you solve the following problem: Given that the resource allocation of a system as follows,

      Allocation
    Task  A B C D
    T1    1 2 0 2
    T2    0 1 1 2
    T3    1 2 4 0
    T4    1 2 0 1
    T5    1 0 0 1
    
          Max
    Task  A B C D
    T1    4 3 1 6
    T2    2 4 2 4
    T3    3 6 5 1
    T4    2 6 2 3
    T5    3 1 1 2
    

    determine whether each of the following states is unsafe. If the state is safe, illustrate the order in which the threads may complete. Otherwise, illustrate why the state is unsafe.

    1. Based on the description of the problem, is this deadlock avoidance or deadlock detection?
    2. Available = (2, 2, 2, 3)
    3. Available = (4, 4, 1, 1)