title: VB.NET: Do I need to call Thread.MemoryBarrier() before each read if I always complete my writes with Thread.MemoryBarrier()?
body: <p>VB.Net does not have an equivalent of C# volatile keyword so you have to manually implement volatile which is usually done by calling Thread.MemoryBarrier() before read and after write. So something like this is equivalent to declaring C# volatile variable:</p>
  
  <pre><code>    ''' &lt;summary&gt;
      ''' Gets a value indicating whether this instance is disposed.
      ''' &lt;/summary&gt;
      Public Property IsDisposed As Boolean
          Get
              Threading.Thread.MemoryBarrier()
              Return _isDisposed
          End Get
          Private Set(value As Boolean)
              _isDisposed = value
              Threading.Thread.MemoryBarrier()
          End Set
      End Property
  </code></pre>
  
  <p>I am wondering of the memory barrier before read is necessary if the only place where I write to the variable is through a setter and there I always call Thread.MemoryBarrier() after the write.</p>
  
  <p>Can I safely remove the Thread.MemoryBarrier() before read?</p>
  
  <p>Edit: To make it more clear I am asking if I can remove the Thread.MemoryBarrier() before read in order to remove costs of memory fence for each read.</p>