Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-05-30 06:20:18

From: "Ralf W. Grosse-Kunstleve" <rwgk_at_[hidden]>
> --- Peter Dimov <pdimov_at_[hidden]> wrote:
> > From: "Ralf W. Grosse-Kunstleve" <rwgk_at_[hidden]>
> > > > | Lars Gullik Bjønnes' recent contribution to shared_ptr has a
> > dependency on
> > > > | sched_yield (as do most optimized lightweight_mutex
> > >
> > > Is it possible to disable the thread facilities with a #define?
> >
> Great, this works for us. Thanks!
> Just a remark: to me it seems odd that thread support is on by default. To
> it would make more sense if I had to request thread support if I want it,

Thread support is in "autodetect" mode by default. Many compilers #define a
predefined macro (_MT, _REENTRANT, etc) in multithreaded mode; Boost.Config
recognizes these macros and defines BOOST_HAS_THREADS automatically.
BOOST_DISABLE_THREADS overrides the autodetection.

Unfortunately, g++ doesn't have a separate multithreaded mode. On Linux, its
library will even supply stub pthread_ and sched_ functions automatically,
if you don't link to -lpthreads / -lrt (an annoying habit.)

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