MSDN declares that
long, ulong, double and decimal, as well as custom types are not guaranteed as atomic 5.5. Atomicity of variable references
Will it Volatile.Write Method (Double%, Double)work like an atomic operation? If so, how is this guaranteed?
Volatile.Write Method (Double%, Double)
Is it possible to do Volatile.Write(ref mydouble, value);in one thread and Volatile.Read(ref mydouble)in another where type mydoublehas double?
Volatile.Write(ref mydouble, value);
Volatile.Read(ref mydouble)
mydouble
double
That was a general question. Another question: what should I do in this particular situation:
, , , Interlocked, Interlocked.Exchange, Interlocked.Read
Interlocked
Interlocked.Exchange
Interlocked.Read
: , Volatile , SMP ( > 1 ). .
, . , ?