|
Boost : |
From: Jason House (jhouse_at_[hidden])
Date: 2003-12-30 13:04:11
Peter Dimov wrote:
> When multiple threads are involved there is a race condition between the
> unique() test and the actual release, and I'm not sure how such a feature
> would interact with a lock-free implementation.
I think this statement might be incorrect. If nothing else, I think
some careful thought about it might yield an easy solution to the problem.
If I understand right, a shared_ptr will be unique if and only if it
is the only shared_ptr to that object. In that scenario, there will be
no other shared_ptr's in any other threads that could cause the
reference count to change from 1 at any instant in time...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk