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.


Paolo Carlini wrote:
Jonathan, for the configury bits (please accept in advance my excuses
if my suggestions are obvious), I think we should have something very
similar to the allocator bits ([GLIBCXX_ENABLE_ALLOCATOR], mt vs new)
: just go through the various available compare_and_swap and select
the compare_and_swap way as default for such targets, otherwise, for
all the other targets, the solution using empty critical sections as
per Alexander and Peter messages.

Apologies for repeating myself, but this is an important point: the empty critical sections fix a different problem (memory visibility). The compare_and_swap way is not a substitute for them. It eliminates the non-empty critical section in add_ref_lock, nothing more.



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