Boost logo

Boost :

From: Geurt Vos (G.Vos_at_[hidden])
Date: 2003-08-28 10:15:34


> 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.
>

Agreed. Still, this doesn't imply you shouldn't _also_ provide
multi-threaded libs by default. I mean, what is it to you if
there's libboost_filesystem_mt.a, libboost_regex_mt.so, etc. for
multi threading, while you can simply use -lboost_regex when
linking your single threaded application?

> 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.
>

The default build is single threaded, while there's also by default a
Boost.Threads build, which is at least partially useless, because I
can't use it together with boost libraries that require linking.

Now that surprises me...

Geurt


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