Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Peter Dimov Date : Sun Apr 10 2005 05:16 pm Chris Thomasson wrote: >> Can I get the best of both worlds by providing the following two >> methods in >> shared_ptr: >> >> template class shared_ptr >> { >> // ... >> >> shared_ptr copy() const; >> void replace( shared_ptr const & pt ); >> }; >> >> with the guarantee that competing accesses to 'copy' and 'replace' >> work (but >> other competing accesses are still disallowed in order to avoid an >> acquire except in 'copy')? > > You can. How are you going to allow for "competing access"? Are you > using mutexs, or going for a lock-free method such as SMR? I was thinking DWCAS or mutex pool... I'm new to these lock-free things. Need to read about SMR, I guess. .