Compare wait-die deadlock prevention scheme with wait-wound scheme
Ans: Wait-Die Scheme
a) Based upon a nonpreemptive technique.
b) If Pi requests a resource presently held by Pj, Pi is allowed to wait only if it has a smaller timestamp after that does Pj (Pi is older than Pj). Otherwise, Pi is rolled back (dies).
c) Example: Assume that processes P1, P2, and P3 have timestamps 5, 10, and 15, correspondingly.
d) If P1 requests a resource held by P2, after that P1 will wait.
e) If P3 requests a resource held through the P2, then P3 will be rolled back. Wound-Wait Scheme
f) Based upon a preemptive methods; counterpart to the wait-die system.
g) If Pi requests a resource presently held by Pj, Pi is allowed to wait only if it has a larger timestamp after that does Pj ( Pi is younger than Pj). If not, Pj is rolled back ( Pj is wounded by Pi).
h) Example: Assume that processes P1, P2, and P3 have timestamps 5, 10, and 15, respectively.
i) If P1 requests a resource held by P2, after that the resource will be preempted from P2 and P2 will be rolled back.
j) If P3 requests a resource held by P2, after that P3 will wait.