Boost logo

Boost Users :

Subject: Re: [Boost-users] [thread] understanding multiple statically-linked boost::thread in same process
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-01-28 07:28:58


> i am debugging an application where several shared libraries contain
> statically-linked copies of boost::thread (and other boost components).
> this means the static part of boost::thread is multiple times present in
> the process.

Yeah, don't do that. Don't mix multiple copies of any Boost or STL or
indeed any C++ library in the same process unless the library explicitly
guarantees you are allowed to. If it doesn't say, then you're not
allowed to.

> if we dynamically link boost the problems go away. i can superficially
> understand that linking only one "common" instanceof boost::thread is
> "more safe".

Not "more safe". Just "safe".

> what could be the explanation for this observation? is this setup even
> supported? one theory is that the implementations
> in pthread/thread_heap_alloc.hpp interfere with each other...

You can try raising it as a bug with Thread, but if I were still a
maintainer there I'd close it immediately as wontfix invalid.

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