title: Volatile DateTime
body: <p>As <code>DateTime</code> cannot be declared as <code>volatile</code>, is this right?</p>
  <pre><code>private DateTime _time;
  public DateTime Time
  {
      get
      {
          Thread.MemoryBarrier();
          return _time;
      }
      set
      {
          _time = value;
          Thread.MemoryBarrier();
      }
  }
  </code></pre>
  <p>That property could be accessed from different threads, so I want to ensure they get always the latest version, without use contention (<code>lock</code>).</p>
  <p>EDIT:</p>
  <ul>
  <li>I have a collection of hard-to-create items, each one has a <code>DateTime</code> property named <code>CreationTime</code>, indicating when this item was created. It's initialized to <code>DateTime.UtcNow</code>.</li>
  <li>Every time a item is accessed, that property is updated to <code>DateTime.UtcNow</code>.</li>
  <li>There is a thread, that executes in timely fashion in a threaded timer that checks <code>if (DateTime.UtcNow + 1 hour) &gt; item.CreationTime</code>, if true it deletes the item.</li>
  </ul>
  <p>I want to ensure that when the &quot;deletion thread&quot; comes into the collection, all the items have their latest &quot;last access&quot; <code>DateTime</code> on it, so I can avoid create the item again just because a cache held the value for a couple of milliseconds. :D</p>