6.4 Deadlock prevention


An indirect method of deadlock prevention is to prevent the occurrence of one of the first three necessary conditions. A direct method of deadlock prevention is to prevent the occurrence of a circular wait.
Mutual exclusion: The operating system has to support the mutual exclusion of resources.
Hold and wait: The hold-and-wait condition can be prevented if the process has to request all the
needed resources at one time.
No preemption: This condition can be prevented if a process cannot have a requested resource will
release its original resources.
Circular wait: This condition can be prevented if the resources are defined in order. Then the process
can request the resources in order.