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.


Jonathan Wakely wrote:

>Soooooooo, for now, I will just commit my original patch posted here:
>http://gcc.gnu.org/ml/libstdc++/2005-03/msg00354.html
>(after waiting a while for any more feedback)
>
>And then address the visibility problems by adding empty critical sections
>(option (1) referred to above)
>  
>
Why not adding the empty critical sections too, in one shot?

>And then we can discuss future improvements such as using CAS instead of
>a mutex, providing synch. guarantees for the atomics, or introducing
>memory barriers to libstdc++.  None of those improvements can be made
>without changing other parts of libstdc++.
>
>Please bear in mind that currently std::tr1::shared_ptr can't be used in
>multithreaded code even on a uniprocessor machine where there are no
>memory visibility issues!  Let's make it work first, then make it work fast.
>  
>
100% agreed.

Paolo.


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