Concurrency Control
Shared vs Exclusive Locks
Shared locks can coexist, while exclusive locks conflict with another holder.
Shared and exclusive locks
A shared lock can coexist with another shared lock on the same item. An exclusive lock conflicts with another holder. Note: the lock table is recomputed from the requested operations.
Shared locks can coexist
The shared-lock example has 2 holders and 0 wait-for edges. Note: shared holders are shown in the rendered lock table.
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.
Exclusive request waits
The exclusive request example recomputes 1 wait-for edge. Note: the waiter appears in the lock table and 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.
Summary
Lock compatibility decides whether a request is granted or waits. Note: 2PL and MVCC are exact protocol traces here; real lock managers, timeouts, garbage collection, and isolation tuning are beyond these traces.