Deadlock Detection
Lock Mgr maintains a “Waits-for” graph:
- Node for each Xact.
- Arc from Ti to Tj if Tj holds a lock and Ti is waiting for it.
Periodically check graph for cycles.
“Shoot” some Xact to break the cycle.
Simpler hack: time-outs.
- T1 made no progress for a while? Shoot it.
To lock such rascal counters from his friends,
Be ready, gods, with all your thunderbolts:
-- Shakespeare, Julius Caesar