Concurrency Control
Deadlock Is a Wait-for Cycle
A cycle in the wait-for graph is a deadlock.
Deadlock is a wait-for cycle
A wait-for graph has one node per transaction and one edge from waiter to holder. Deadlock is detected by a graph cycle. Note: the verdict caption falls out of the cycle check.
Cycle highlighted
The deadlock example has 2 wait-for edges and a cycle of length 2. Note: cycle edges are highlighted in the graph.
2PL and MVCC are exact protocol traces on tiny schedules; real lock managers, deadlock avoidance/timeouts, version garbage-collection, and isolation-level tuning are beyond these traces - no product claims.
Acyclic wait contrast
The contrast schedule has cycle length 0. Note: a wait without a cycle is rendered with no highlighted cycle edges.
2PL and MVCC are exact protocol traces on tiny schedules; real lock managers, deadlock avoidance/timeouts, version garbage-collection, and isolation-level tuning are beyond these traces - no product claims.
Summary
The deadlock verdict is a deterministic wait-for cycle check. Note: 2PL and MVCC are exact protocol traces here; real lock managers, timeouts, garbage collection, and isolation tuning are beyond these traces.