title: How to implement thread safe reference counting in C++
body: <p>How do you implement an <strong>efficient and thread safe reference counting system</strong> on X86 CPUs in the C++ programming language? </p>
  
  <p>I always run into the problem that the <strong>critical operations not atomic</strong>, and the available X86 Interlock operations are not sufficient for implementing the ref counting system.</p>
  
  <p>The following article covers this topic, but requires special CPU instructions:</p>
  
  <p><a href="http://www.ddj.com/architect/184401888" rel="noreferrer">http://www.ddj.com/architect/184401888</a></p>