
11 Mar
2008
11 Mar
'08
7:11 p.m.
Mathias Gaunard:
Peter Dimov wrote
Mathias Gaunard:
I see that shared_ptr is quite costly in multithreaded environments cause it would need DCAS, and thus uses a spinlock in cases where it is not available.
Where do you see that? It's not true.
AFAIK, the current shared_ptr is not lock-free at all.
It is lock-free on most platforms. Look at the code, particularly boost/detail/sp_counted_base*.hpp.