3 ms·
An atomic reference count seems sufficient, but I could be wrong.
by aidenn0 3y ago
An atomic reference count seems sufficient, but I could be wrong.
- gpderetta 3y agoIt is actually quite tricky to lock-free swap a concurrently-accessed reference counted pointer. The reference count is not associated with the pointer, but with the pointee, so a 2CAS is not enough. Typically you need hazard pointers or similar deferred reclamation tricks.