# Concurrency Control

Record: `arch:concurrency-control`
Kind: mechanism
Layer: [Atomic Boundary](https://banes-lab.com/records/layer/atomic-boundary.md)
Severity: mandatory
Scope: transaction, memory, distributed system
Canonical: https://banes-lab.com/ontology#arch-concurrency-control

## Repair

- Refactored by: Add Locking, Use Immutable State, Add CAS
- Detected by: race detectors, flaky concurrent tests
- Violated by: unsynchronized shared mutation
- Measured by: race count, contention
- Enforced by: thread-safety analysis, [tests](https://banes-lab.com/records/lex/tests.md)

## requires

- [Shared State Identification](https://banes-lab.com/records/lex/shared-state-identification.md)

## reinforces

- [Isolation](https://banes-lab.com/records/arch/isolation.md)
- [Correctness](https://banes-lab.com/records/arch/correctness.md)

## enables

- [Safe Parallel Mutation](https://banes-lab.com/records/lex/safe-parallel-mutation.md)

## conflicts-with

- [Race Conditions](https://banes-lab.com/records/lex/race-conditions.md)
- [Lost Update](https://banes-lab.com/records/arch/lost-update.md)

## tensions-with

- [Performance](https://banes-lab.com/records/lex/performance.md)

## tensions

- [Concurrency Control Performance](https://banes-lab.com/records/tension/concurrency-control-performance.md)

## referenced-by

- [Concurrency](https://banes-lab.com/records/arch/concurrency.md)
- [Isolation](https://banes-lab.com/records/arch/isolation.md)
- [Optimistic Locking](https://banes-lab.com/records/arch/optimistic-locking.md)
