
11 Mar
2008
11 Mar
'08
6:59 p.m.
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. Discussion about making it lock-free said it required to use DWCAS (cmpxchg16b on x86-64). It seems, however, this wasn't implemented.