The sequence of the instructions executed from 2 threads on a single core cannot be predicted. The following is a possible sequence, when both threads attempt to do i++, but the effect is equivalent to doing i++ once:
load i # thread 1
system interrupt
load i # thread 2, now i++ in thread 1 is not complete
increment i # thread 2
store i # thread 2
system interrupt
increment i # thread 1, actually the same value
store i