Boost logo

Boost :

From: Iain K. Hanson (iain.hanson_at_[hidden])
Date: 2003-08-28 08:48:19


On Thu, 2003-08-28 at 09:00, Geurt Vos wrote:
> >
> > > [ this is about whether <threading>single or <threading>multi ]
> > > [ should be the default jam option for building boost. Single ]
> > > [ is currently the default ]
> >
> > (**) I think I want to hear one or two other opinions before we decide
> > this decision was wrong. People seemed pretty well convinced it was
> > right once upon a time.
> >
>
> I think the decision was wrong. I think neither makes
> sense as default. I mean, it depends on the application
> whether single or multi threading is required. So why
> not build single _and_ multi threaded libs. Just like
> the default build results in 'debug' and 'release' libs.
>
I disagree. Most applications are single threaded and it takes a very
conscious choice and a lot of thought to go multi threaded. You have to
set compiler flags for MT, you have to link against special versions of
the standard C libs. You have to remember that most implementations of
the standard C++ libs are not thread safe in the sense they do not use
mutexes. You also have to remember to use re-entrant versions of
functions. These are not things that can or should be defaulted IMHO.

MT also has a cost in both space and time. One that is completely
unnecessary for single threaded programs.

It is neither a gotcha nor surprising that the default boost build is
single threaded even though boost has a threads library. My Linux box
comes with pthreads and my Windows box has threads but the default
builds on both are single threaded.

I suspect that only someone new to threads would be surprised by this
and it should probably be in the threads FAQ.

my 2p worth

/ikh


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