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.

Level: advancedTopic: Computing foundations

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.