开发者

looking for the NAME of a specific kind of concurrency problems

开发者 https://www.devze.com 2022-12-14 01:48 出处:网络
You have the followi开发者_如何学Gong scenario: //Two threads, using shared data shared data = 2 Thread1: reads shared data

You have the followi开发者_如何学Gong 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.


Isn't that simply known as a race condition?

0

精彩评论

暂无评论...
验证码 换一张
取 消