stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Teleman <stefan.tele...@gmail.com>
Subject Re: STDCXX-1056 [was: Re: STDCXX forks]
Date Thu, 13 Sep 2012 05:40:08 GMT
On Wed, Sep 12, 2012 at 9:04 AM, Liviu Nicoara <nikkoara@hates.ms> wrote:
>
> That would be very helpful!

I ran your test case - with your implementation of _numpunct.h - and I
even wrote a variant of it because I wanted to be able to test with
more than one locale at a time:

http://s247136804.onlinehome.us/stdcxx-1056-20120912/22.locale.liviu-1.mt.cpp

They pass and they did not cause assertions. I initially had a concern
about the case where two or more different threads ask for facet data
on the same static locale object, ahd they happen to do so exactly at
the same time. But there is a mutex in __rw_setlocale which will
serialize this. Incidentally there are some optimizations which could
be done in __rw_setlocale's constructor as well, along with the
optimizations for the "C" locale in punct.cpp Martin mentioned
yesterday.

The performance of 22.locale.numpunct.mt is also much better with your
_numpunct.h patch:

real 668.93
user 804.00
sys 34.24

--Stefan

-- 
Stefan Teleman
KDE e.V.
stefan.teleman@gmail.com

Mime
View raw message