CS FundamentalsHardGATE CS (PYQ pattern)

Transactions T1..T5 have timestamps equal to their numbers (T1 is oldest). Seven independent lock conflicts occur, written (requester, current holder): (T2,T4), (T3,T1), (T4,T2), (T5,T1), (T1,T3), (T5,T3), (T4,T1). Under wait-die, an older requester waits and a younger requester aborts itself; under wound-wait, an older requester aborts the holder and a younger requester waits. How many aborts happen under wait-die and under wound-wait respectively?

  1. A. 2 and 5
  2. B. 5 and 2
  3. C. 5 and 5
  4. D. 6 and 1

Correct answer: B. 5 and 2

Wait-die: the requester aborts when it is younger than the holder: (T3,T1), (T4,T2), (T5,T1), (T5,T3), (T4,T1) = 5 aborts. Wound-wait: the holder is aborted when the requester is older: (T2,T4), (T1,T3) = 2 aborts.

More DBMS and SQL questions

Exams that ask this topic