Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Joe Seigh Date : Thu Apr 14 2005 09:48 am On Thu, 14 Apr 2005 15:08:55 +0300, Peter Dimov wrote: > Joe Seigh wrote: >> The ppc version of atomic_ptr uses different interlocked logic since >> ppc doesn't have double wide CAS. > > Is your PPC version available? On http://sourceforge.net/projects/atomic-ptr-plus/ in the atomic_ptr package there's a ppc32 version available. I didn't get a Mac until recently, so I wasn't able to publish a working implementation of the algorithm until now. > >> The template vs. macros and intrusive vs. non-intrusive are just details. > > I'm not sure. It's the details that make your atomic_ptr unique. A > straightforward smart pointer with an atomic swap() seems pretty trivial, > even I was able to "invent" it once (with the same lack of memory barriers > as in Reinholz's code). > The atomic swap is one part. The other part is safely incrementing the reference count without "owning" it first. There's the DWCAS solution, the PPC solution, and various GC based solutions using RCU, SMR, etc... And of course the 2CAS solution which only works on MC68020 and MC68030 processors. -- Joe Seigh .