Boost logo

Boost :

From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2004-04-24 22:27:44

On Sat, 24 Apr 2004 19:20:00 -0400
Howard Hinnant <hinnant_at_[hidden]> wrote:

> Actually I'm not convinced about this. I have the same concerns as
> Bronek. They are only concerns. I am not sure of myself. But here's
> a data point:

I do not buy that argument either.

> Perhaps a more correct statement is that if you expose a shared_ptr as
> part of your interface, and advertise that multiple threads can
> operate on copies of that exposed shared_ptr, then shared_ptr must be
> internally protected. But if your shared_ptr is used as an
> implementation detail within your library, an internal mutex is not
> necessarily beneficial, and may even be a handicap.

I believe this is actually easier than specified, if the locking is part
of the type. For instance, the ACE+TAO philosophy is to make
synchronization a template parameter. While there may be some other
issues with this approach, it allows classes to be used as they are
needed. The programmer can use both MT and ST objects, as they are
required. I have found this pattern very beneficial, and believe the MT
issues of shared_ptr to be problematic at best.

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