~/talk

A lock-free atomic shared_ptr

Talkat NDC TechTown 2022 · 2022-08-29..09-01· [concurrency, c-and-cpp]
links:none on file
slides:none on file

Shows that a lock‑free std::atomic<std::shared_ptr> is implementable by using a split refcount (local + global) and either a packed pointer or double‑width CAS; builds prototypes and compares three open implementations (Folly is production‑ready, others are proof‑of‑concept). Benchmarks report lock‑free versions are slower on average but give orders‑of‑magnitude better worst‑case latency, and packed‑pointer variants run 2–3× faster. Notes practical problems: aliasing requires extra allocation or pointer‑delta packing, and portability breaks across compilers/CPUs.

AI-written summary · about

  1. 0:00Introduction
  2. 1:04Atomic shared pointer basics
  3. 7:03Shared pointer internals
  4. 9:04Atomic operations and C++20
  5. 16:04The lock-free implementation challenge
  6. 21:29Split reference counting algorithm
  7. 32:21Optimizations and trade-offs
  8. 35:26Handling aliased shared pointers
  9. 44:23DWCAS and pointer packing
  10. 52:55Existing implementations and benchmarks
  11. 58:27Future work and conclusion
~/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.