title: Thread.VolatileRead() vs Volatile.Read()
body: <p>We are told to prefer <a href="http://msdn.microsoft.com/en-us/library/system.threading.volatile.read%28v=vs.110%29.aspx" rel="noreferrer">Volatile.Read</a> over <a href="http://msdn.microsoft.com/en-us/library/System.Threading.Thread.VolatileRead%28v=vs.110%29.aspx" rel="noreferrer">Thread.VolatileRead</a> in most cases due to the latter emitting a full-fence, and the former emitting only the relevant half-fence (e.g. acquire fence); which is more efficient.</p>
  
  <p>However, in my understanding, <code>Thread.VolatileRead</code> actually offers something that <code>Volatile.Read</code> does not, because of the implementation of <code>Thread.VolatileRead</code>:</p>
  
  <pre><code>public static int VolatileRead(ref int address) {
    int num = address;
    Thread.MemoryBarrier();
    return num;
  }
  </code></pre>
  
  <p>Because of the full memory barrier on the second line of the implementation, I believe that <code>VolatileRead</code> actually ensures that the value last written to <code>address</code> will be read.
  According to <a href="http://en.wikipedia.org/wiki/Memory_barrier#Low-level_architecture-specific_primitives" rel="noreferrer">Wikipedia</a>, <em>"A full fence ensures that all load and store operations prior to the fence will have been committed prior to any loads and stores issued following the fence."</em>.</p>
  
  <p>Is my understanding correct? And therefore, does <code>Thread.VolatileRead</code> still offer something that <code>Volatile.Read</code> does not?</p>