Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Peter Dimov Date : Fri Apr 15 2005 01:37 pm Chris Thomasson wrote: >> The point is that you no longer need tricks in the copy constructor. >> The original race is only a problem when the count is 1 so that you >> can have the >> assignment destroy the count and then the copy constructor attempt to >> increment it. > > No. Yes, it's broken. A non-tricky copy constructor cannot be made race-resistant, no matter how I fiddle with the assignment. Its thread can always be preempted after it loads the pointer for just enough time for some other thread to destroy the count. .