CS238 Operating Systems
Ching-yi Au
Introduction:
A Deadlock occurs when there are a set of processes that are each holding some resources. Although each one are requesting some resources, none of them can obtain what it needs to progress.
There are four basic situations that if held simultaneously, can cause a deadlock to arise:
The Wound – Wait scheme:
In order to prevent a deadlock,
use of resources may be constrained. The Wound-Wiat scheme is based on a preemptive technique; counterpart
to the waitdie system.
If Pi requests a resource
currently held by Pj , Pi is allowed to wait only
if it has a larger timestamp than does Pj (Pi is
younger than Pj ). Otherwise, Pj is rolled
back (Pj is wounded by Pi ).
Example: Suppose that processes P1,
P2, and P3 have timestamps 5, 10, and 15,
respectively .
If P1 requests a resource
held by P2 , then the resource will be preempted from P2
and P2 will be rolled back.
If P3 requests a resource
held by P2, then P3 will wait.
An introduction describing demonstration.
Diagram describing the event sequence of three transactions: T1, T2 and T3.