Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#.NET memory modelSingle-choice MCQ

Under the ECMA-335 / .NET memory model, a thread writes to a non-volatile reference field that points to a freshly constructed object whose fields were initialized in the constructor. Another thread reads the reference (non-volatile) and observes it as non-null. Without any explicit barriers, what does the CLR memory model on ARM64 actually guarantee about the object's fields seen by the reader?

// Thread A _shared = new Box { Value = 42 }; // non-volatile field write // Thread B var b = _shared; if (b != null) { int v = b.Value; // may observe 0 on ARM64 }