|
|
|
|
|
by jaen
14 days ago
|
|
Smart pointers ie. reference counting are a (not very good) form of GC... Especially in multi-threaded settings, smart pointers perform poorly (compared to GC) due to requiring atomics on hot paths, and the alternative (epochs, hazard pointers, RCU) is orders of magnitude more complicated to get exactly right than just using GC. This also explains why historically the most interesting concurrent data structures were first implemented in Java, not C++. eg. Java got a decent concurrent hash table WAY before anything else - in 2003 vs. the 2006 initial release of Intel TBB, and the performance was not as good for all use cases. C++ performance did not catch up until ~2017 with the release of folly::ConcurrentHashMap! |
|