• preemptable resource
  • nonpreemptable resource

deadlock

  • conditions: (known as the Coffman conditions)
    • Mutual exclusion
    • Hold and wait or resource holding
    • No preemption:
    • Circular wait: There is a set of waiting processes , s.t. is waiting for a resource held by .
  • handling:
    • ignoring
      • ostrich algorithm
    • detection and recovery
      • detection
        • (system) resource-allocation graph
          • : set of active threads
          • : set of resource types
          • request edge : thread has requested an instance of resource type
          • assignment edge : an instance of resource type has been allocated to thread
        • Multiple Resources
          • current allocation matrix
            • : total number of each resource type
            • number of instances of resource type currently allocated to thread
          • request matrix
            • : number of available instances of each resource type
            • number of instances of resource type requested by thread
          • invariant:
      • recovery
        • preemption
        • rollback
          • checkpoints
        • procces killing
    • avoidance
      • resource trajectories
      • safe states
      • Banker’s algorithm
    • prevention