3 ms·
from the ECMA-335 standard (which is not the latest reference, but is easily accessible): "A conforming CLI shall guarantee that read and write access to prope
by dsp1234 10y ago
from the ECMA-335 standard (which is not the latest reference, but is easily accessible):
"A conforming CLI shall guarantee that read and write access to properly aligned memory locations no larger than the native word size (the size of type native int) is atomic (see §I.12.6.2) when all the write accesses to a location are the same size."
Since references are the native word size, the CLR will ensure that there is no tearing.
Note that it is possible to produce a torn read variables that are larger than a native-int, even of native types such as decimal[1].
[0] - http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-335.pdf http://www.ecma-international.org/publications/files/ECMA-ST... section I.12.6.6, page 102
[1] - http://stackoverflow.com/questions/23262513/reproduce-torn-reads-of-decimal-in-c-sharp http://stackoverflow.com/questions/23262513/reproduce-torn-r...