Berildocs GitHub

Memory cards

A lock manager has modes, a wait queue and fairness

confidence: mediumupdated: 2026-11-25status: activedatabaselocksfairness

Claim#

Shared and exclusive modes conflict by a matrix. The wait queue needs ordering and timeout.

Test#

Request conflicting modes from two sessions. Check the queue and the timeout.

Proof#

A predictable grant order and a clean timeout.

Failure modes#

A lock upgrade can deadlock. A queue without fairness starves.