Deadlock
Using a diagram called the Resource-Allocation graph, we can, in may cases, learn if a deadlock occurs.
This graph contains the following components:
- Resource categories: {R0, R1, R2, ..., RM}, which we show on the graph using square box nodes. Each box will contain at least one dot to indicate specific instances of a resource. For instance, two dots might represent two laser printers.)
- Processes: {P0, P1, P2, ..., PN}. The # of processes might be different from this of resource categories.
- Request arrows. An arrow from some process Pi to some resource category Rj indicates that Pi wants to use an instance of Rj. It doesn't matter which instance will be used since any instance of this resource will do.
- Assignment arrows. An arrow from an instance (dot) of some resource Rj to some process Pi tells that this specific instance of Rj is currently held by process Pi.