datarace
A datarace, or data race, is a condition in concurrent programming where two or more threads access the same memory location concurrently, and at least one of the accesses is a write, with no proper synchronization or ordering guarantees between the accesses. When a datarace can occur, the program’s behavior becomes unpredictable and often undefined depending on the language and memory model.
Dataraces arise from shared mutable state that is accessed without appropriate synchronization. Causes include omissions of
The formal treatment of dataraces varies by language. In C and C++11 and later, a data race
Detection and mitigation efforts include using race detectors (such as ThreadSanitizer or Helgrind), static analysis, and