Definition
A concurrency fault in which program behavior or outcome depends on the relative timing or ordering of operations on shared resources, so different interleavings produce different results, some of which may be incorrect or unsafe.

Principle

Principle
When multiple concurrent agents (threads, processes, interrupts) access and at least one modifies shared state without proper synchronization, the lack of a defined ordering makes results nondeterministic and sensitive to scheduler timing, caches, or I/O.

Demonstration

Demonstration
Two threads increment a shared counter by reading, incrementing, and writing back without atomic operations or locks; interleavings can lose increments (lost updates). A classic TOCTOU occurs when a file's existence is checked and then used, with another thread changing the file between check and use.

Misapplication

Misapplication
Using 'race condition' to mean any intermittent bug without demonstrating timing‑dependent interactions, or assuming adding arbitrary sleep statements will reliably reproduce or fix the problem; also believing locks always eliminate risk without considering deadlocks or priority inversion.

Consequence

Consequence
Correctly recognizing race conditions leads to appropriate synchronization (locks, atomics, transactions) or redesign for immutability, producing deterministic behavior; left unresolved they cause intermittent failures, data corruption, or security vulnerabilities that are hard to reproduce.

Reversal

Reversal
Serializing access to the shared resource, using atomic primitives, message‑passing, or designing immutable data structures reverses the nondeterminism by enforcing a well‑defined order or eliminating shared mutable state.

Boundary

Boundary
Includes data races and higher‑level race conditions; distinguishes from deadlock and livelock (where progress halts or spins) and from pure algorithmic nondeterminism that does not arise from unsynchronized shared‑state access.

Semantic Tension

Semantic Tension
Tension exists between 'data race' (a low‑level unsynchronized memory access) and broader 'race condition' (which may include ordering of higher‑level operations). There's also tension in describing observed nondeterminism as concurrency vs environmental nondeterminism.

Synthesis

Synthesis
A race condition is a timing‑sensitive concurrency fault where unsynchronized access to shared state yields nondeterministic and potentially incorrect outcomes; it is demonstrated by lost updates or TOCTOU bugs, misattributed when timing is not shown, and addressed by synchronization, atomics, or design changes that restore determinism.