[prev] 22 [next]

Deadlock (cont)

Methods for managing deadlock
  • timeout : set max time limit for each tx
  • waits-for graph : records Tj waiting on lock held by Tk
    • prevent deadlock by checking for new cycle abort Ti
    • detect deadlock by periodic check for cycles abort Ti
  • timestamps : use tx start times as basis for priority
    • scenario: Tj tries to get lock held by Tk ...
    • wait-die: if Tj < Tk, then Tj waits, else Tj rolls back
    • wound-wait: if Tj < Tk, then Tk rolls back, else Tj waits