In context of deadlock prevention in DBMS, wait-die and wound-wait schemes are…
2022
In context of deadlock prevention in DBMS, wait-die and wound-wait schemes are ........ techniques.
Answer: D. non-preemptive and preemptive respectively — ConceptTimestamp-based deadlock prevention assigns each transaction an age from its timestamp and permits waits only in one age direction, so a circular wait…
- A.
both preemptive
- B.
both non-preemptive
- C.
preemptive and non-preemptive respectively
- D.
non-preemptive and preemptive respectively
Attempted by 320 students.
Show answer & explanation
Correct answer: D
Concept
Timestamp-based deadlock prevention assigns each transaction an age from its timestamp and permits waits only in one age direction, so a circular wait cannot form.
A scheme is non-preemptive when the requesting transaction never forces the lock holder to roll back; it is preemptive when the requester can force the holder to roll back.
Application
Wait-die: if the requester is older than the holder, it waits. If the requester is younger, the requester itself is rolled back and restarted with the same timestamp. Because the requester never displaces the holder, wait-die is non-preemptive.
Wound-wait: if the requester is older than the holder, the younger holder is rolled back and the older requester proceeds. If the requester is younger, it waits. Because the requester can displace the holder, wound-wait is preemptive.
Therefore, the applicable pairing is: wait-die is non-preemptive and wound-wait is preemptive, respectively.
Cross-check
The classification follows who can be rolled back: wait-die may roll back only the requester, whereas wound-wait may roll back the transaction already holding the lock.
Scheme | Older requester | Younger requester | Classification |
|---|---|---|---|
wait-die | waits for the younger holder | rolls itself back | non-preemptive |
wound-wait | rolls back the younger holder | waits for the older holder | preemptive |
Result: wait-die is non-preemptive and wound-wait is preemptive, respectively.