[patch] Make std::tr1::shared_ptr thread-safe.
Alexander Terekhov
alexander.terekhov@gmail.com
Tue Mar 29 16:21:00 GMT 2005
On Tue, 29 Mar 2005 17:50:35 +0200, Paolo Carlini <pcarlini@suse.de> wrote:
> Alexander Terekhov wrote:
>
> >[... __release/acquire_memory_barrier() ...]
> >
> >>The only reliable implementation of these barriers that I see
> >>is an empty pthread_mutex_lock/pthread_mutex_unlock pair.
> >>
> >>
> >Nope. That won't work.
> >
> Sorry about the trivial question (I'm not MT expert, at least not 'til
> today: thanks for the helpful messages!): won't work in principle or
> won't work *given the classes of optimizations* implemented in the
> current GCC generation?
It won't work on Itanic (with pthread_mutex_lock/pthread_mutex_unlock
impls NOT injecting "mf") even if GCC would "implement" all sorts of
MT constraints as full-stop bidirectional asm-volatile-with-memory-
clobber-or-whatnot fence silliness as it, in fact, does currently
(unless I've just missed something) apart from data-dependent stuff
(because it doesn't do data-dependent reordering stuff like value
prediction which hardware can do).
regards,
alexander.
More information about the Libstdc++
mailing list