Deadlock Prevention (cont.)
- No Preemption:
- If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released.
- The state of preempted resources has to be saved and later restored. Not practical for many types of resources (e.g. printer).
- Circular Wait:
- Impose a total ordering on all resource types.
- Require each process to request resources only in a strict increasing order.
- Resources from the same resource type have to be requested together.