title: Overhead and implementation of using shared_ptr
body: <p>Short introduction: I am working on multithread code and I have to share dynamically allocated objects between two threads. To make my code cleaner (and less error-prone) I want to explicitly "delete" objects in each thread and that's why I want to use <code>shared_ptr</code>.</p>
  
  <p><strong>First question:</strong></p>
  
  <p>I want to know if implementation of <code>-&gt; operator</code> in <code>shared_ptr</code> has some extra overhead (e.g. larger then <code>unique_ptr</code>) during run time. Objects I am talking about are usually longlife instances copied only once after creation (when i distribute them between threads), then I only access these objects' methods and fields.</p>
  
  <p>I am aware, that <code>shared_ptr</code> only protect reference counting.</p>
  
  <p><strong>Second question:</strong></p>
  
  <p>How well are <code>shared_ptr</code> optimized in libstdc++? Does it always use mutex or take advantage of atomic operations (I focus on x86 and ARM platforms)?</p>