~/talk

A Lock-Free Atomic Shared Pointer in Modern Cpp

Talkat CppCon 2022 · 2022-09-11..09-16· [rust]
links:none on file
slides:none on file

Claims a portable, practical implementation of a lock-free std::atomic<std::shared_ptr> and explains how it actually works: a split refcount algorithm plus tricks like pointer packing and optional refcount batching. Compares GCC/MSVC standard libs (they use mutexes), Folly (production, lock-free via packing), and proof‑of‑concepts (double-width CAS, intrusive or allocation-heavy alias handling). Benchmarks show higher average cost but far better worst‑case latency; discusses aliasing, allocator and portability tradeoffs and which implementations are ready to use.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03Atomic shared pointers matter
  3. 7:04Shared pointers thread safety
  4. 14:29Problem with C++20 atomic shared pointers
  5. 19:29Existing lock-free implementations
  6. 27:17How lock-free atomic shared pointers work
  7. 36:43Alias constructors in lock-free
  8. 44:42Double-width CAS and CPU compatibility
  9. 53:51Comparing lock-free implementations
  10. 57:01Benchmarking lock-free vs mutex
  11. 1:00:53Future plans and goals
~/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.