
5 Mar
2004
5 Mar
'04
7:43 p.m.
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. Regards, John McGinty