Deadlocks Definition A set of processes is in a Deadlock state when every process in the set is waiting for an event that can only be caused by another process in the set.
Four Necessary Conditons Mutual exclusion Hold and Wait No preemption Circular Wait
System Resource Allocation Graph A Directed Graph Vertices: processes (p) in the system, or resource types (r) in the system. Edges: (p,r) is the request edge, and (r,p) is the assignment edge.
Handling Deadlocks Prevention Avoidance Recovery
Deadlock Prevention Must ensure that (at least) one of the four necessary conditions CAN NOT occur Mutual exclusion Hold and Wait No preemption Circular Wait
Deadlock Avoidance Require enough information to ensure a Safe Sequence and a Safe State. Each process must declare its Maximum Need. Banker’s Algorithm