Subj : Re: Lock Free Programming with Boost::shared_ptr instead of Hazard Pointers To : comp.lang.c++.moderated,comp.programming.threads From : Ronald Landheer-Cieslak Date : Tue Mar 22 2005 06:23 pm Joe Seigh wrote: > Roshan Naik wrote: >>2) Shared_ptr is not thread safe ?? I dont know. But it is possible that >> it is currently not implemented to perform its operations in an >>atomic/thread-safe fashion. But perhaps that can be fixed (with help >>from the future standard..volatile/CAS). But ofcourse, hazard pointers >>technique also relies on the similar requirements from the standard. > I believe there's a parameter to make it mostly threadsafe. The non > thread-safe part is you have to know the refcount of any shared_ptr's > you copy won't go to zero during the copy operation. Basically, you > have to "own" the shared_ptr you're copying. Which basically conforms to the "an object can't protect against it's own destruction" mantra. Doesn't that also hold true for the atomic_ptr? (Haven't checked yet, so really don't know). rlc [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] .