AI engineering glossary · Computing foundations
What is race condition?
Race condition: A bug where the result of a program depends on the unpredictable order in which threads or processes touch shared data. It can produce wrong values that appear only occasionally, which makes it hard to reproduce.
Race condition: an example
Two threads each read a counter of 5, add 1 and write back, so the counter ends at 6 instead of 7.
Related terms
More Computing foundations terms
- Random access memory
- Reference counting
- Register
- Reverse proxy
- Round-trip time
- Router
- Scheduler
- Secure Shell
Where you learn it
Race condition is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.