Lecture 013

Deadlock Avoidance

Assumptions:

Safe Execution Sequence:

Safe State:

Resource Manager:

A safe system: system have enough resources for P1 to finish, then it will have enough resources for P0 then P2 to finish.

A safe system: system have enough resources for P1 to finish, then it will have enough resources for P0 then P2 to finish.

For above image, P_1, P_0, or P_2 might not ask for "Room" resources, but we need to prepare for the worst case.

An unsafe system: stuck after P1 finish. A deadlock is not inevitable, but possible.

An unsafe system: stuck after P1 finish. A deadlock is not inevitable, but possible.

State Change Intuition

State Change Intuition

Implementation:

Avoidance

Deadlock Recovery

Detection:

Recovery:

Table of Content