Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-09-25 07:21:26


From the perspective of a library writer, the following scenarios are
possible:

1. It's unknown whether the implementation supports threads;

2. It is known that the implementation does not support more than one thread
(single threading mode);

3. It is known that the implementation supports multiple threads but
BOOST_DISABLE_THREADS has been defined;

4. It is known that the implementation supports multiple threads but the
underlying threading model is unknown;

5. It is known that the implementation supports multiple threads, the
underlying threading model is known, but is not supported by Boost.Threads;

and

6. It is known that the implementation supports multiple threads, the
underlying threading model is known, and is supported by Boost.Threads.

The current macros don't seem to provide this information.

Why is this information important for library writers? Assume that you're
writing a robust thread safe library. You want to fail at compile time in
(1) and (4), optimize out the synchronization in (2), use native primitives
in (5), use Boost.Threads primitives in (6), and do whatever you consider
appropriate in (3) (possibly do (2) with a warning.)

--
Peter Dimov
Multi Media Ltd.

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