Boost logo

Boost :

From: Tom Widmer (tom_usenet_at_[hidden])
Date: 2004-03-08 05:19:36

On Fri, 5 Mar 2004 11:43:12 -0800, "John McGinty" <john_at_[hidden]>

>Is there any reason why shared_ptr does not use atomic_count (using
>InterlockedIncrement, InterlockedDecrement) for the reference count?
>The lightweight mutex used to protect the count in the current
>implementation is a spin lock that sleeps when contended. Using
>atomic count would offer performance improvements in both the
>uncontended and contended cases.

You can't atomically modify two variables at once without some kind of
mutex but there are two reference counts. I suspect that's the reason.


C++ FAQ:

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