|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-11-20 07:14:04
From: "Mac Murrett" <mmurrett_at_[hidden]>
> So long as there is already a dependency upon some kind of Boost threading
> library (BOOST_HAS_THREADS), why not use Boost.Threads?
Good question.
First, BOOST_HAS_THREADS doesn't mean 'Boost.Threads is available.' It means
'the implementation is in some kind of multi-threaded mode.'
Second, Boost.Threads doesn't provide an atomic reference counter. In order
to emulate one, we'll have to use boost::mutex. This, in turn, will mean
that shared_ptr users will need to build and deploy Boost.Threads, a cost
that some (many) of them might not want to pay.
> Doing this would
> give us a poor-man's version for any platform (using similar logic to that
> of the POSIX implementation), which we could then specialize for other
> platforms as is advantageous (e.g., your Windows implementation or a Mac
OS
> implementation using AddAtomic).
Not agreed. This will give us a version for platforms that Boost.Threads
supports, not just any platform. Which currently doesn't mean much - but
this can change in the future.
> Also, should the implementation of this not be part of Boost.Threads? It
> would seem to me that implementing this would be part of porting
> Boost.Threads to a new platform, and so it belongs there.
It is my opinion that it belongs there as well, but Bill Kempf did not agree
when I brought this up.
-- 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