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

Paolo Carlini pcarlini@suse.de
Fri Apr 1 13:48:00 GMT 2005


Alexander Terekhov wrote:

>>but Alexander does. (It needs to establish ordering of prior
>>loads WRT following stores IIUC). This will be fixed by (3) and may or may
>>not be a problem in practice; I'm not an expert in this area and can't
>>review the current __exchange_and_add implementations. In any event,
>>shared_ptr with the above fixes applied would be no more broken than the
>>rest of the library.
>>    
>>
>The rest of the library is currently totally broken in this respect 
>I'm afraid.
>
>It works on IA32 (compiler reordering aside for a moment) because on 
>IA32 loads have acquire semantics, stores have release semantics, and
>interlocked stuff is fully-fenced (compound acquire+release semantics).
>  
>
Alexander and Peter,

I'm trying to understand the basic implications of your interesting
analyses. Can you possibly point out some specific broken codepaths?
Much better, prepare, pragmatically, one or more C++ snippet using the
library that fails in a consistent way on a specific arch (!= IA32, of
course). Sooner or later, after all the deep analyses we have to start
*doing* something and that would be a nice starting point, in my
opinion: right now we are simply *totally* lacking feedback from the
users about the brokeness.

Thanks in advance,
Paolo.



More information about the Libstdc++ mailing list