G
George Ter-Saakov
What is the purpose of having Interlocked.Increment if it does not work with
variable declared as volatile.
Here is my problem,
Interlocked.Increment increments the variable in thread safe manner.
But at the same time if i want to use variable that could be changed in
another thread i must use volatile (to prevent optimization).
But then i can not use Interlocked.Increment.
So i do not see any benefits of having Interlocked.Increment because i can
not think of any use of it.
Thanks.
George.
variable declared as volatile.
Here is my problem,
Interlocked.Increment increments the variable in thread safe manner.
But at the same time if i want to use variable that could be changed in
another thread i must use volatile (to prevent optimization).
But then i can not use Interlocked.Increment.
So i do not see any benefits of having Interlocked.Increment because i can
not think of any use of it.
Thanks.
George.