Katana VentraIP

Race condition

A race condition or race hazard is the condition of an electronics, software, or other system where the system's substantive behavior is dependent on the sequence or timing of other uncontrollable events, leading to unexpected or inconsistent results. It becomes a bug when one or more of the possible behaviors is undesirable.

"Critical race" redirects here. For the academic movement, see Critical race theory.

The term race condition was already in use by 1954, for example in David A. Huffman's doctoral thesis "The synthesis of sequential switching circuits".[1]


Race conditions can occur especially in logic circuits or multithreaded or distributed software programs. Using mutual exclusion can prevent race conditions in distributed software systems.

Workarounds[edit]

Design techniques such as Karnaugh maps encourage designers to recognize and eliminate race conditions before they cause problems. Often logic redundancy can be added to eliminate some kinds of races.


As well as these problems, some logic elements can enter metastable states, which create further problems for circuit designers.

a memory and thread checking and debugging tool to increase the reliability, security, and accuracy of C/C++ and Fortran applications; Intel Advisor, a sampling based, SIMD vectorization optimization and shared memory threading assistance tool for C, C++, C#, and Fortran software developers and architects;

Intel Inspector

ThreadSanitizer, which uses binary (-based) or source, LLVM-based instrumentation, and supports PThreads;[20] and Helgrind, a Valgrind tool for detecting synchronisation errors in C, C++ and Fortran programs that use the POSIX pthreads threading primitives.[21]

Valgrind

Data Race Detector is designed to find data races in the Go Programming language.

[22]

Call collision

Concurrency control

Deadlock

Hazard (logic)

Linearizability

Racetrack problem

Symlink race

Synchronization (computer science)

Time of check to time of use

Test-and-set

Karam, G.M.; Buhr, R.J.A. (August 1990). "Starvation and Critical Race Analyzers for Ada". . 16 (8): 829–843. doi:10.1109/32.57622.

IEEE Transactions on Software Engineering

Fuhrer, R.M.; Lin, B.; Nowick, S.M. (March 1995). "Algorithms for the optimal state assignment of asynchronous state machines". Advanced Research in VLSI, 1995. Proceedings., 16th Conference on. pp. 59–75. :10.1109/ARVLSI.1995.515611. ISBN 978-0-8186-7047-3. S2CID 4435912. as PDF Archived 2021-06-10 at the Wayback Machine

doi

Paper "" by Luciano Lavagno, Cho W. Moon, Robert K. Brayton, and Alberto Sangiovanni-Vincentelli

A Novel Framework for Solving the State Assignment Problem for Event-Based Specifications

Wheeler, David A. (7 October 2004). . IBM developerWorks. Archived from the original (PDF) on February 1, 2009. Alt URL

"Secure programmer: Prevent race conditions—Resource contention can be used against you"

Chapter " Archived 2014-03-09 at the Wayback Machine" (Secure Programming for Linux and Unix HOWTO)

Avoid Race Conditions

with sample source code and comparison to C code, by Chiral Software

Race conditions, security, and immutability in Java

Karpov, Andrey (6 April 2009). .

"Interview with Dmitriy Vyukov - the author of Relacy Race Detector (RRD)"

Microsoft Support description

Race Condition vs. Data Race