Race Condition

The race condition is flow in a system of processes where by the output of the process is dependent on the sequence of the process.  Race condition accrue among processes that share common storage and each process can read write on this shared common storage. The race condition occurs to in proper synchronization of shared memory access.

E.g. Race condition representing two processes Process 1 and Process 2 want to increment the value of global integer i.
int i=10
Process 1
P1 reads : The value of i from memory into a register : 10
P1 increment : The value of i in register +1=11
P1 storage : The value of the register in memory : 11
Process 2
P2 reads : The value of i from memory into a register : 11
P2 increment : The value of i in register +1=12
P2 storage : The value of the register in memory : 12