This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: [patch] Make std::tr1::shared_ptr thread-safe.


Peter Dimov wrote:

> Robert's suggestion, if I understand correctly, is to use a mutex for
> all operations, including counting (what boost::shared_ptr currently
> does on non-Windows platforms). This is guaranteed to be safe, but may
> generate some bad publicity, as the recent c.l.c++.m thread has shown.

Frankly, I don't care much about "publicity" and such (at least in this
specific case ;) We are talking about our *first* experimental delivery
of shared_ptr. It's only a starting point, we are all humbly learning
about *many* different topics in this area, *nothing* more.

> However, if __exchange_and_add is reviewed and found/changed to be
> fully-fenced, this will automatically take care of all memory
> visibility issues in shared_ptr as well.

Very nice. And a review is needed *anyway*: nobody did it, until today,
to my best knowledge.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]