Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-01-07 18:47:04


> Aleksey, your method should work ( I would still check this
> addding printout statements).
> No matter how wonderful such a method is and how useful
> it could be to implement, say, synchronized containers,
> my point was that using mutexes to synchronize shared_ptr
> reference counting is a huge overkill - instead of changing
> one instruction from simple increment to atomic one,
> you would _add_ new data members and mutex syncronization
> which is much more that atomic increment. Also, shared_ptr
> does not neeed to be fully synchronized, only assignment does.

I think you're missing the key advantage here, Boris: the mutexted<T>
template could be specialized for shared_ptr (in a platform-specific way, of
course) so as to avoid any unneccessary overheads.

-Dave


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