~/talk

atomic_try_update - A more, better compare-and-swap

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp]
links:none on file
slides:none on file

Provides small wrapper functions that replace manual CAS loops with a lambda that computes the new value and optionally whether to perform the swap, simplifying common patterns like counting strings or folding a 64-bit time into 32 bits. Uses standard atomics under the hood and chooses the four‑argument compare_exchange form to satisfy Clang. Shows a claim-bit plus ABA counter example for lockless work stealing, avoids unnecessary CAS attempts for a measurable perf win, and improves readability. atomic_update atomic_try_update

AI-written summary · about

  1. 0:00Introduction to Atomic
  2. 0:31Challenges with atomic loads
  3. 2:22Atomic update wrapper
  4. 3:43Atomic try update
  5. 4:43Complex state 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.