Boost logo

Boost-Build :

Subject: Re: [Boost-build] Default threading model in Linux
From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-11-09 11:35:50


On Sunday 09 November 2008 19:16:39 Joaquin M Lopez Munoz wrote:
> Vladimir Prus <ghost <at> cs.msu.su> writes:
>
> >
> > On Sunday 09 November 2008 17:20:43 Joaquin M Lopez Munoz wrote:
> > > Hello all,
> > >
> > > What is the default threading model (i.e. threading=single
> > > or threading=multi) assumed by Boost.Build on Linux systems?
> >
> > By default, Boost.Build uses threading=single on all systems.
> > I've just committed a doc patch to say so.
> >
> > On the other hand, I suspect you wanted to ask a different question.
> > In particular, when building C++ Boost on Linux, threading=multi is
> > used.
>
> No, I'm referring to the threading model assumed when, for instance,
> building a test with
>
> test-suite "foo" : [ run foo.cpp ] ;
>
> So, threading=single is assumed here, right?

I don't understand what "assumed" means. When every target is built,
all non-optional feature has a specific value -- there's nothing
to "assume". Unless you did something to force MT, threading=single
will be in effect.

> That poses a
> small problem, as on the other hand BOOST_HAS_THREADS and
> BOOST_HAS_PTHREADS seem to be unconditionally defined,

By what code? On gcc, those are set only if -pthread is added to gcc
options during compilation.

> which
> can lead to Pthreads being used by foo.cpp, but not linked
> by bjam.

Please look at the exact command lines for both compilation and linking.
If compilation command has -pthread, and linking command does not, it's
Boost.Build bug. Otherwise, it's Boost.Config bug. In both cases,
a reproducible test case will be needed. (And make sure you have up-to-date
SVN HEAD).

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk