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: [patch] Make std::tr1::shared_ptr thread-safe.


Jakub Jelinek wrote:
Even as an interim solution it sounds wrong.  The lock has been added
to this method only, so it would only protect from concurent
add_ref_lock calls.  But _M_use_count is changed in a bunch of other
methods as well, so either you use atomic instructions everywhere, or
you use (the same) lock everywhere, but mixing that just can't work.

It is correct, to the best of my knowledge. This is Tyson Whitehead's CASless modification of the original CASful algorithm by Alexander Terekhov.


http://lists.boost.org/MailArchives/boost/msg66868.php


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