小编Den*_*ers的帖子

Multiple Invokes and thread safety

Lets assume that I have worker threads that increment a value on some control. Since an invoke is required, all the increments need to be done on the GUI thread. For that I use BeginInvoke.

My question is:

Can a race condition break the increment of the control, because multiple worker threads all invoked on the GUI thread simultaniously (and the increment itself someControl.Value += value; is obviously not atomic)?

Or to put it the opposite:

Is one Invoke guaranteed …

.net c# thread-safety invokerequired

1
推荐指数
1
解决办法
79
查看次数

标签 统计

.net ×1

c# ×1

invokerequired ×1

thread-safety ×1