title: Are reads and writes to properties atomic in C#?
body: <p>Reads and writes to certain primitive types in C# such as <code>bool</code> and <code>int</code> are atomic. </p>
  
  <p>(See section 5.5, "5.5 Atomicity of variable references", in the C# Language Spec.)</p>
  
  <p>But what about accessing such variables via properties? Is it reasonable to assume that they will also be atomic and thread-safe? E.g. Is a read of <code>MyProperty</code> below atomic and thread-safe?:</p>
  
  <pre><code>public bool MyProperty { get { return _foo; } }
  </code></pre>
  
  <p>And what about auto-implemented properties?</p>
  
  <pre><code>public bool MyProperty { get; }
  </code></pre>