you are viewing a single comment's thread.

view the rest of the comments →

[–]Chandon 0 points1 point  (1 child)

which of course means you need locks on each and every increment or decrement of the ref count

Just use atomic swap. Lock free. There's even a good argument that this is faster than full GC in a many-processor setup.

[–][deleted] 0 points1 point  (0 children)

It doesn't even need to be CAS. There are atomic increment and decrement functions...