Previous | Next --- Slide 15 of 40
Back to Lecture Thumbnails
sanchuah

What is non-waiting deadlock prevention? and what is wait-and-die deadlock prevention?

cube

From the paper:

2PL with Non-waiting Deadlock Prevention (NO_WAIT): Unlike deadlock detection where the DBMS waits to find deadlocks after they occur, this approach is more cautious in that a transaction is aborted when the system suspects that a deadlock might occur [3]. When a lock request is denied, the scheduler immediately aborts the requesting transaction (i.e., it is not allowed to wait to acquire the lock).

2PL with Waiting Deadlock Prevention (WAIT_DIE): This is a non-preemptive variation of the NO_WAIT scheme technique where a transaction is allowed to wait for the transaction that holds the lock that it needs if that transaction is older than the one that holds the lock. If the requesting transaction is younger, then it is aborted (hence the term “dies”) and is forced to restart [3]. Each transaction needs to acquire a timestamp before its execution and the timestamp ordering guarantees that no deadlocks can occur.