Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Peter Dimov Date : Mon Apr 11 2005 04:40 pm Joe Seigh wrote: > On Mon, 11 Apr 2005 14:26:44 +0300, Peter Dimov > wrote: >> This is about local_shared_ptr, not about copy/replace. The >> local_shared_ptrs in an ownership group (which needs to be local to a >> specific thread) use a local unsynchronized reference count to keep >> track of their single shared_ptr-like reference into the shared_ptr >> group. ChrisX got it right, but I still think that there's no need >> to acquire in the increment, it's an ordinary 'add_ref_strong'. > > As a practical matter I don't think you're going to have have more > than one local pointer copy of a global shared pointer often enought to > justify the extra overhead of maintaining a separate reference count > and of the extra indirection. You may well be right. It's just one idea for a possible extension of shared_ptr that could pacify the "we want our unsynchronized pointers" portion of the "C++ community". I'm not sure yet whether it's a _good_ idea. .