title: std::shared_ptr thread safety
body: <p>I've read that </p>
  
  <blockquote>
    <p>"Multiple threads can simultaneously read and write different
    shared_ptr objects, even when the objects are copies that share
    ownership." (<a href="http://msdn.microsoft.com/en-us/library/c9ceah3b%28v=vs.100%29.aspx" rel="noreferrer">MSDN: Thread Safety in the Standard C++ Library</a>)</p>
  </blockquote>
  
  <p>Does that mean that changing shared_ptr object is safe ?<br>
  For an instance, is the next code considered safe:</p>
  
  <pre><code>shared_ptr&lt;myClass&gt; global = make_shared&lt;myClass&gt;();
  ...
  
  //In thread 1
  shared_ptr&lt;myClass&gt; private = global;
  ...
  
  //In thread 2
  global = make_shared&lt;myClass&gt;();
  ...
  </code></pre>
  
  <p>Can I be sure in that case that thread 1 <code>private</code> will have the original value of <code>global</code> or the new value which thread 2 assigned but either way it will have a valid shared_ptr to myClass?</p>
  
  <p>==EDIT==<br>
  Just to explain my motivation. I want to have a shared pointer to hold my configuration and I have a thread pool to handle requests.<br>
  so <code>global</code> is the global configuration.<br>
  <code>thread 1</code> is taking the current configuration as it start to handle a request.<br>
  <code>thread 2</code> is updating the configuration. (only apply to future requests)  </p>
  
  <p>If it's work, I can update the configuration that way without breaking it in the middle of a request handling.</p>