Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Peter Dimov Date : Sun Apr 10 2005 05:23 pm Chris Thomasson wrote: >> As a practical matter, I'd think you'd want some mechanism to >> distinguish between shared global pointers and non-shared local >> pointers. > > Agreed. For instance, I had to separate my atomic pointer into two > distinguishable classes to address a highly critical performance > issue: > shared_smr_ptr > local_smr_ptr > > > shared_smr_ptr alone is "way to expensive" to be used for a general > purpose smart pointer. That's what people tell me all the time, that shared_ptr is too expensive and they need an "unsynchronized" variant. But it's not quite the same as Joe's local_ptr, I think; it still atomically updates its count. I think I'll reserve the local_ptr name for a pointer that uses a "local" count and non-atomic updates (but is convertible from and to a shared_ptr) so that people are free to shoot themselves in the foot, if they so insist. .