Resource Graphs
Given the four preconditions, some schedules may lead to circular waits.
- Deadlock is easily seen with a resource graph or wait-for graph.
The graph has a vertex for each process and each resource.
If process A holds resource R, add an arc from R to A.
If process A is waiting for resource R, add an arc from A to R.
The system is deadlocked iff the wait-for graph has at least one cycle.