Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Joe Seigh Date : Sat Apr 16 2005 09:15 am On Sat, 16 Apr 2005 14:57:12 +0300, Peter Dimov wrote: > Chris Thomasson wrote: >> So, atomic_ptr for PPC-64 needs to have some sort of static/tracked >> storage wrt atomic_ptr_ref's? You can get around all of that by >> allocating static or "collected" arrays of atomic_ptr_ref's. Then you >> would use the index to atomic_ptr_ref as the "pointer" to it. > > But what happens when the static array overflows? > > I think Chris is talking about the using 32 bit offsets into a fixed storage pool instead of 64 bit pointers to get around a lack of space in interlocked instructions for the latter. PPC-64 has ldarx/stdcx so it's not an issue. You have to use this trick on systems that don't have DWCAS (CMPXCHG16B). You can make the storage pool up to 4 GB with the restriction of however many refcount meta objects fit in there (if you're using non-intrusive refcounting). -- Joe Seigh .