~/talk

Concurrency Improvements in C++20: A Deep Dive

Talkat Core C++ 2023 · 2023-06-05..06-07· [c-and-cpp]
slides:none on file

C++20 adds concrete concurrency primitives and shows what to use and why: lock‑free algorithms via compare_exchange (example: an atomic multiply implemented with a CAS loop), atomic_ref to prevent data races on referenced objects (proven with ThreadSanitizer), new atomic wait/notify and atomic smart‑pointer specializations (atomic shared_ptr is thread‑safe but not lock‑free), semaphores, latches and reusable barriers, and cooperative interruption with stop_source/stop_token plus callbacks and an auto‑joining std::jthread. A ping‑pong benchmark of 1,000,000 ping‑pong exchanges reports semaphores and atomics as 10× faster than condition_variable and far simpler to read.

AI-written summary · about

  1. 0:00Introduction to concurrency
  2. 8:21History of atomics in C++
  3. 12:16Atomic operations and compare exchange
  4. 20:51C++20 atomic extensions
  5. 23:23Atomic notifications vs condition variables
  6. 34:23Ping pong performance comparison
  7. 45:58Latches and barriers explained
  8. 53:08Cooperative thread interruption
  9. 1:03:04Automatic thread joining
  10. 1:07:18Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.