Must invalidate one of the four necessary conditions for a deadlock.
- Mutual exclusion — Not required for sharable resources like read-only files, but must hold for non-shareable resources.
- Hold and wait — Must guarantee that a process can only hold on resource at a time. This might be done by requiring a process to request and be allocated resources before it starts, or only allow it to request resources when there are none allocated to it. This potentially leads to low resource utilisation and starvation.
- No preemption — If a process is holding some resources requests another that cannot be immediately allocated, all resources it currently holds are released. These preempted resources are then added to list of resources for which the process is waiting, and the process is then only restarted when it can regain all the resouces in this list.
- Circular wait — Impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration.
It is most common to invalidate the Circular Wait condition. It simply requires that each resource is enumerated, and they then must be acquired in order.