Deadlock Avoidance
Requires that the system has some additional a priori information available
Simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need
The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that there can never be a circular-wait condition
Resource-allocation state is defined by the number of available and allocated resources, and the maximum demands of the processes
Safe State
- If Pi resource needs are not immediately available, then Pi can wait until all Pj have finished
- When Pj is finished, Pi can obtain needed resources, execute, return allocated resources, and terminate
- When Pi terminates, Pi +1 can obtain its needed resources, and so on
Basic Facts
Safe, Unsafe, Deadlock State
