On 04/10/2016 04:22 PM, Artyom Beilis wrote:
Ok this kind of suff is missing in the docs... I don't see the "algorithm" section.
It isn't clear to me, The root_ptr holds linked list to blocks... that if you delete a single node_ptr so its ref-counter goes to 0 and object is destroyed, what happens to its block - removed from linked list, is it used as cache for reuse?
If the ref count goes to 0, the block is deleted and removed from the intrusive list automatically. There is no caching.
How the list is protected for thread safety? By global mutex???
If so I see a great potential for a contention that makes it far worst than shared_ptr.
I could optimize that global mutex and make it part of a node_proxy (set) but I didn't see an immediate need after running the benchmark and I had other cats to whip.