A bug whose outcome depends on the unpredictable timing or interleaving of concurrent operations.
A race condition is a class of software bug in which the behavior of a program depends on the unpredictable timing or interleaving of concurrent operations, such that the same input can produce different outputs depending on which operation completes first. The term entered computer science in the mid-1960s with the rise of multi-process and multi-threaded systems and is now a foundational concept in concurrent programming, distributed systems, and operating systems. Race conditions are distinct from the governance terms "race to the top" and "race to the bottom" — those are competitive dynamics metaphors, while race condition refers to a specific technical failure mode in systems with shared mutable state.
A race condition emerges when three conditions hold: (1) two or more operations access the same shared resource (memory location, file, database row, hardware register); (2) the operations interleave in ways that are not fully serialized; (3) at least one of the operations is a write that modifies the shared resource. Under these conditions, the order in which the operations execute determines the final state of the resource, and when that order is not deterministic (because of OS scheduling, network latency, hardware interrupts, or thread-pool sizing), the program's behavior becomes non-deterministic and potentially incorrect. Classic examples include two threads both incrementing a shared counter (lost updates), two processes both writing to the same file (corrupted data), and check-then-act sequences where the check and the act are separated by a context switch.
Race conditions are conceptually simple but operationally expensive: they are often not reproducible because the timing that triggers them is sensitive to system load, scheduler behavior, and hardware differences. The trade-off is between strict synchronization (locks, mutexes, transactions, atomic operations) that prevents races but reduces parallelism and adds latency, versus optimistic concurrency (compare-and-swap, lock-free data structures, eventual consistency) that allows races to occur but detects and resolves them. Each approach has correctness guarantees and performance costs; the discipline of concurrent programming is choosing the right synchronization primitive for the access pattern and the consistency requirements.
Whether agentic AI systems introduce qualitatively new kinds of race conditions beyond those in classical concurrent systems — for example, races between an LLM agent's reasoning and a tool's response, or between two agents collaborating on a shared task. Whether formal methods and model checking, which can statically prove the absence of certain race conditions, will scale to LLM-mediated workflows whose semantics are not formally specified. Whether the "TOCTOU" (time-of-check-to-time-of-use) variant of race conditions, which has become a recurring security vulnerability class (TOCTOU bugs in symlink handling, container escapes, AI agent tool invocation), requires new defensive patterns beyond traditional locking. Whether the term's metaphorical use in "AI race" governance discourse has caused confusion that warrants reserving the term for the technical concept only.
Wikipedia
Signals turns a topic into a sourced research record you can inspect and rerun. Your first scan is free, and this one starts with Race Condition already loaded, so edit it or scan as is.