Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-05-18 07:51:23

On Tue, May 18, 2004 at 04:13:43PM +0400, Vladimir Prus wrote:

> John Maddock wrote:
> > > Actually, I just don't want to pay for MT, unless I really mean to use
> > > the code in MT environment.
> >
> > I understand that, but we have to decide how to handle this, so that it is
> > actualy safe, and in particular boost headers should honor the compilers
> > default setting.
> I think I'm confused over what's "default setting" is, and if it important. I
> think the point is that
> 1. User should be able to specify if boost libraries should be thread-safe
> 2. He should do this with a minimum of effort. This is especially important
> for compile-only library
> So, if compiler has an option to tell if application should be build in MT
> mode, *that option* should affect thread safety of boost libraries. It's
> actually not very related to MT-safety of standard lib.

That's exactly what the previous config that relied on _REENTRANT was
supposed to do. (It was imperfect since not all platforms defined the
macro when -pthread was given - it only really worked for Linux and a
few other platforms)

And if a new macro such as __GXX_PTHREADS is added for GCC 3.4.1 then
I assume it's exactly what the new Boost config will try to do too.

> Quite the contrary, I think we need to respect compiler switches, but not
> library settings. Anyway, this is only important if we can get gcc to
> reliable report -pthread presense.

Which should happen for 3.4.1.

In any case Boost should document that you need to explicitly define
BOOST_DISABLE_THREADS if using GCC 3.4.0 and you don't want MT.


"He who knows does not speak.
 He who speaks does not know."
	- Lao Tze

Boost list run by bdawes at, gregod at, cpdaniel at, john at