|
Boost : |
From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-05-04 10:06:53
Larry Evans wrote:
[snip]
>
> I hope that's correct. Now, if this is true, then I think things could
> be speeded up by using "weighted reference count" or WRC's.
> With WRC's, the only time a lock is needed is during deletion of
> a smart_ptr.
The last sentence overstated the case. Whenever an "arc" is
deleted is when a lock is needed. In other words, if
smart_weighted_ptr::get is non-null,
then when it changes to another referent, the previous referent's
weighted reference count must be updated; hence, a lock is required.
However, the new referent's reference count is NOT updated, only
the smart_weighted_ptrs' (the source and target) weighted reference
counts are updated. Hence, less than 1/2 of the locks are required. The
number of locks correspond to the number of reference count decrements
in the current smart_ptr.
At least I think that's right. Maybe Jones or Lins could correct me.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk