Deadlock prevention

Denying the necessary conditions

Denying the hold and wait condition can also be done if a process releases the already acquired resource(s) if it fails to acquire the next one.

  • Later on, it can try the acquisition again.

In the dining-philosopher problem, a philosopher must release the left fork if she/he fails to acquire the right one.

  • In this solution, starvation and busy waiting can occur.

    • Aging mechanisms are often used to solve starvation.

    • To avoid busy waiting, the process should block and be waked up when the resource is released.

Last updated