On 09/13/12 01:40, Stefan Teleman wrote: > On Wed, Sep 12, 2012 at 9:04 AM, Liviu Nicoara 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: Did you happen to test a single-threaded build as well? Thanks, Liviu