Boost logo

Boost :

From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-01-11 21:46:36


On Wed, 12 Jan 2005 01:37:15 +0100
"Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> wrote:

> Maybe it could have threading policy, defaulting to the
> same mechanism shared_ptr uses, other options being
> no-locking and user-locking.

Umm... not trying to start a war or anything, but please do not do
that. Personally, I do not like the threading policy of shared_ptr. I
use it, but I really do not like it. In general, the Boost preference
seems to be compiled code is either multithread enabled or not (i.e.,
object are different sizes based on compile time macros).

In my experience, I have found making the thread policy an actual policy
(similar to how ACE does it) better. It allows me to compile/link
different policies, depending on how they are used.

For example, if I have a multi-threaded application, Boost classes
require me to use all multithreaded support. However, my main thread
may be tight, and use shared_ptr objects that do not span multiple
threads. In that case, I'd like to use something like shared_ptr< Foo,
Noop_Lock_Policy > for stuff I know is OK without locking...


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