But a similar issue lurks with loads of the fields. Because all of the processors mentioned above, in addition to the .NET memory model, allow load-to-load reordering in some circumstances, the load of
m_value could move after the load of the object’s fields. The effect would be similar and marking
volatile prevents it. Marking the object’s fields as volatile is not necessary because the read of the value is an acquire fence and prevents the subsequent loads from moving before, no matter whether they are
volatile or not. This might seem ridiculous to some: how could a field be read before a reference to the object itself? This appears to viola...
Share this highlighthttp://www.safaribooksonline.com/a/concurrent-programming-on/13094306/