A race condition happens when two or more tasks use the same information at nearly the same time, and the order they happen in changes the result.

Imagine two people looking at a shelf with one item left. Both see it, both try to take it, and the records may end up showing the wrong number. The problem is not that either person moved too slowly; it is that their actions overlapped.

Programs can prevent some race conditions by coordinating access to shared information. They can be hard to reproduce because timing may change from one run to another.