title: Does Interlocked provide visibility in all threads?
body: <p>Suppose I have a variable "counter", and there are several threads accessing and setting the value of "counter" by using Interlocked, i.e.:</p>
  
  <pre><code>int value = Interlocked.Increment(ref counter);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>int value = Interlocked.Decrement(ref counter);
  </code></pre>
  
  <p>Can I assume that, the change made by Interlocked will be visible in all threads? </p>
  
  <p>If not, what should I do to make all threads synchronize the variable?</p>
  
  <p>EDIT: someone suggested me to use volatile. But when I set the "counter" as volatile, there is compiler warning "reference to volatile field will not be treated as volatile".</p>
  
  <p>When I read online help, it said, "A volatile field should not normally be passed using a ref or out parameter".</p>