Boost logo

Boost :

Subject: Re: [boost] [filesystem] path thread safety fix impact on POSIX systems
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-12-30 12:44:14


On 12/30/2011 02:48 PM, Beman Dawes wrote:
> Class path locale initialization has suffered from a data race for
> several releases.
> See https://svn.boost.org/trac/boost/ticket/6320 for an example of
> code that suffers as a result.
>
> The problem was introduced when locale initialization was changed from
> namespace scope initialization to function scope initialization. For
> Windows and Mac OS X, the fix is simply to change back to namespace
> scope initialization.
>
> For non-BSD based POSIX systems such as Linux, the problem is more
> complex. These system need std::locale(""), "the locale-specific
> native environment".

 From what you're saying, function-scope static initialization is only
required on Linux.

Then you say that the problem is that function-scope static
initialization is not thread-safe.

But function-scope static iniitalization is thread-safe with conforming
C++11 compilers, and has been thread-safe with GCC and other compilers
that follow the Itanium ABI for a fairly long time.

So the problem seems to be non-existent.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk