[RFC] 12658_thread.cc randomly fails (on MP machines)

Paolo Carlini pcarlini@suse.de
Tue Jul 6 10:51:00 GMT 2004


Nathan Myers wrote:

>I just looked at the PR for the first time.  What a load of nonsense!
>There's no need for mutexes anywhere.  
>
>It would suffice to add calls to add_reference and remove_reference 
>to keep anything from disappearing too early.
>
Hi Nathan. Indeed, I had hopes but haven't been able to figure out
something really working in every circumstance.

Consider the simplest case

  locale::locale() throw() : _M_impl(0)
  {
    _S_initialize();
    __gnu_cxx::lock sentry(__gnu_internal::locale_cons_mutex);
    _S_global->_M_add_reference();
    _M_impl = _S_global;
  }

together with the original report ( 2) ) + Comment #14: how can you
possibly deal with those patterns??

Thanks,
Paolo.



More information about the Libstdc++ mailing list