title: is it thread safe to assign a new value to a static object in c#
body: <p>Taking the following code, what happens in a multithreaded environment:</p>
  
  <pre><code>static Dictionary&lt;string,string&gt; _events = new Dictionary&lt;string,string&gt;();
  
  public static Dictionary&lt;string,string&gt; Events { get { return _events;} }
  
  public static void ResetDictionary()
  {
      _events = new Dictionary&lt;string,string&gt;();
  }
  </code></pre>
  
  <p>In a multithreaded environment this method and property can be accessed in the same time by different threads. </p>
  
  <p><strong>Is it thread safe to assign a new object to a static variable that is accessible in different threads?</strong> What can go wrong ?</p>
  
  <p>Is there a moment in time when Events can be null ??  If 2 threads call in the same time <code>Events</code> and <code>ResetDictionary()</code> for example.</p>