views:

22

answers:

1

You have the following scenario:

//Two threads, using shared data

shared data = 2  
Thread1: reads shared data  
Thread2: reads shared data  
Thread1: shared data = read value + 1  
Thread2: shared data = read value + 1  

result: shared data = 3  
//Should have been 4 if not for this problem.

I don't want a solution for the problem, I know how to fix it and it is not relevant for the actual question.

I want the technical term for this specific kind of problem that comes with concurrency. Using it for a technical report.

+8  A: 

Isn't that simply known as a race condition?

Jeremy Friesner
thank you! That's what I'm looking for. I've had it on the tip of my brain so to speak for hours. So frustrating, it kept eluding me. Thanks.
Zen