Boost logo

Boost Users :

Subject: Re: [Boost-users] Compare boost::system::error_category
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-03-25 12:48:00


On 25/03/2017 12:01, Richard Damon via Boost-users wrote:
>>> Boost's quality of implementation is the same as libstdc++ or libc++,
>>> you can get multiple instantiations in certain circumstances and those
>>> can have differing addresses.
>>
>> The various error categories are implemented (for header-only libraries)
>> as inlined Meyer singletons. Does that mean that we have a general
>> problem with such singletons?
>>
> I think the issue is that for C++ versions prior to C++11, it isn't
> guaranteed to be thread safe, as C++ had no concept of threads (which
> sort of makes anything you do with threads problematical). With C++11,
> if fully implemented, it should be thread safe as the standard now
> requires the compiler to implement the required thread safety, the issue
> is that there may be implementation that don't fully provide that as it
> can be a bit expensive in some cases.

I know of no linker based method to bypass multiple category instances
occurring in ELF if a library is loaded via RTLD_LOCAL. You need to fall
back onto named memory maps in that situation.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net