title: Is atomic decrementing more expensive than incrementing?
body: <p>In his <a href="http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/">Blog Herb Sutter</a> writes</p>
  
  <blockquote>
    <p>[...] because <strong>incrementing the smart pointer reference count</strong>
    can usually be optimized to be the same as an ordinary increment 
    in an optimized <code>shared_ptr</code> implementation — just an ordinary increment instruction,
    and no fences, in the generated code.</p>
    
    <p>However, <strong>the decrement must be an atomic decrement</strong> or equivalent,
    which generates special processor memory instructions that are more expensive in
    themselves, and that on top of that induce memory 
    fence restrictions on optimizing the surrounding code.</p>
  </blockquote>
  
  <p>The text is about the implementation of <code>shared_ptr</code> and I am not sure if his remark applies only on this or is generally the case. From his formulation I gather it is <em>generally</em>.</p>
  
  <p>But when I think about it I can only think of "more expensive decrement" when a <code>if(counter==0)</code> immediately follows -- which probably is the case with <code>shared_ptr</code>.</p>
  
  <p>Therefore I wonder if the <em>atomic</em> operation <code>++counter</code> is (usually) <strong>always faster</strong> than <code>--counter</code>, <strong>or just because</strong> it is used <code>if(--counter==0)...</code> with <code>shared_ptr</code>?</p>