incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Liviu Nicoara <nikko...@hates.ms>
Subject Re: STDCXX-1056 [was: Re: STDCXX forks]
Date Tue, 18 Sep 2012 16:43:53 GMT
On 09/18/12 08:55, Stefan Teleman wrote:
> On Mon, Sep 17, 2012 at 11:17 AM, Liviu Nicoara <nikkoara@hates.ms> wrote:
>> I hope you agree that this synchronization is sufficient for the facet
>> initialization and reading of facet data.
>
> I have reduced the number of reported race conditions in
> 22.locale.numpunct.mt from 12440:
>

I am attaching a test program which, while 100% MT-safe, is flagged by the Solaris thread
analyzer. The test program contains, conceptually, the exact same of shared variable access
like the locale management code, the facet management code and the facet data management code.
This proves, if there was a need, that the tool results are to be further analyzed and interpreted
but not taken at literal value.

The fix we are looking for is one which corrects the initial MT failure observed in caching
the facet data, as well as it preserves the unguarded reads of facet data for performance
reasons.

Thanks.

Liviu


> http://s247136804.onlinehome.us/stdcxx-1056-SPARC-20120917/22.locale.numpunct.mt.nts.1.er.html/index.html
>
> to 288:
>
> http://s247136804.onlinehome.us/stdcxx-1056-20120918/22.locale.numpunct.mt.5.er.html/index.html
>
> The changes are in the following files:
>
> http://s247136804.onlinehome.us/stdcxx-1056-20120918/facet.cpp
> http://s247136804.onlinehome.us/stdcxx-1056-20120918/punct.cpp
>
> _numpunct.h looks like this:
>
> http://s247136804.onlinehome.us/stdcxx-1056-20120918/_numpunct.h
>
> With these changes, no races conditions are repoted for any of the
> functions in std::numpunct<T>.
>
> Still, there are 288 race conditions being reported in
> __rw_locale::__rw_locale and in std::locale::_C_get_facet. We need to
> identify the source and cause of these race conditions and correct
> them as well.
>
> This is not a complete solution to the problem, because we still have
> to re-write the chunk of code I eliminated from facet.cpp. It is only
> step one towards finding a real solution. But, at least for now, we
> have pinpointed where the source of these race conditions is located,
> and what causing it.
>
> The test program was run as: ./22.locale.numpunct.mt --nthreads=8
> --nloops=10000.
>
> More to follow.
>
> --Stefan
>

Mime
View raw message