A race condition can arise in software when a computer program has multiple code paths that are executing at the same time. If the multiple code paths take a different amount of time than expected, they can finish in a different order than expected, which can cause software bugs due to unanticipated behavior.
Detecting race conditions is a difficult problem, one whose complexity increases exponentially with the size of the code. Detecting these bugs is hard since they often manifest only when low-probability events occur in a particular sequence.