~/talk

A lock-free std::atomic std::shared_ptr

Talkat ACCU 2022 · 2022-04-06..04-09· [concurrency, c-and-cpp]
links:none on file
slides:none on file

Claims a portable lock-free std::atomic<std::shared_ptr> is implementable using a split refcount design that keeps a control-block pointer and a local refcount in one atomic word, with options of double-width CAS or pointer-packing on 64-bit to make updates atomic. References three open implementations (Anthony Williams, Folly, Vladislav) and shows benchmarks: mutex-backed std::atomic is faster on median cases but lock-free versions give far better worst-case latency; aliasing/allocator edge-cases force trade-offs and the implementation remains work-in-progress.

AI-written summary · about

  1. 0:00Start
  2. 9:35Safety
  3. 12:20Atomic Shared Pointer
  4. 22:57Implementation of a Log Free Stack
  5. 33:24Double Compare and Swap Operation
  6. 34:17Double Width Compartment Swap
  7. 47:43The Shared Pointer
  8. 48:08The Aliasing Constructor
  9. 1:05:39Possible Solutions
  10. 1:07:22Pac-Pointers
  11. 1:21:22Gcc
  12. 1:22:45Takeaways
  13. 1:26:41Matrix of Existing Open Source Implementations
  14. 1:27:19How To Verify that the Code Is Correct
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.