Hello everyone,
Suppose Status is an int variable, which could be read and write by multiple threads.
When assign the value (write) of Status variable, I always use,
My question is, in order to make write/read of this variable thread safe, could I access (read) the variable directly by accessing Status variable, for exampleCode:Interlocked.Exchange(ref Status, SomeValue);
Code:Concole.write (Status); if (Status > 0) { // some ops }
thanks in advance,
George