This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Fw: [patch] Make std::tr1::shared_ptr thread-safe.
On Apr 2, 2005 9:43 PM, Paolo Carlini <pcarlini@suse.de> wrote:
[...]
> Therefore, I think we can safely say that Jonathan patch is OK, or at
> least not worse, from the MT point of view than the rest of the library
Both are broken. Because your current __exchange_and_add() doesn't
provide suffiecent msync semantics for basic thread-safety of refcounting
immutable objects.
Pirate (sink and hoist) talk aside for a moment, in Sparc RMO terms,
it needs
membar load-store
<compound atomic load-modify-store>
membar store-store
to "preserve" the order of preceding loads and subsequent stores
with respect to "dumb" (no value dependent msync) refcount
decrement.
regards,
alexander.