A race condition in concurrent programming arises when multiple processes or threads contend for shared resources. The final outcome is contingent upon the unpredictable sequence of their execution, potentially causing unforeseen behavior or defects due to variations in thread execution timing.
- CPU time competition (A) pertains to CPU scheduling but is not inherently a race condition.
- Unexpected program termination (C) signifies an error with diverse causes, not exclusively linked to race conditions.
- Memory allocation failure (D) is a memory management problem, distinct from race conditions.
Therefore, the accurate answer is (B), where the result is determined by the thread execution order.