title: Illustrating usage of the volatile keyword in C#
body: <p>I would like to code a little program which visually illustrates the behavior of the <code>volatile</code> keyword. Ideally, it should be a program which performs concurrent access to a non volatile static field and which gets incorrect behavior because of that. </p>
  
  <p>Adding the volatile keyword in the same program should fix the problem.</p>
  
  <p>That something I didn't manage to achieve. Even trying several times, enabling optimization, etc., I always get a correct behavior without the 'volatile' keyword.</p>
  
  <p>Do you have any idea about this topic? Do you know how to simulate such a problem in a simple demo app? Does it depend on hardware?</p>