~/talk

Concurrency Improvements in C++20: A Deep Dive

Talkat NDC TechTown 2023 · 2023-09-18..09-21· [concurrency]
slides:none on file

C++20 adds concrete primitives and demos: atomic wait/notify and atomic<shared_ptr> so pointer ops avoid races, compare_exchange_strong loop is used to implement fetch_mul safely, and semaphores/latches/barriers replace many condition_variable uses. A producer/consumer works with atomic_flag wait/notify and with counting semaphores; a 1,000,000 ping‑pong benchmark shows condition_variable much slower while atomics and semaphores are far faster. Cooperative interruption (stop_token/source), std::jthread auto-join, and synchronized ostream flush on scope exit are shown working.

AI-written summary · about

  1. 0:00Introduction
  2. 1:10C++20 concurrency features
  3. 2:12Atomic ops and memory model
  4. 5:26Compare exchange strong
  5. 9:28Atomic flag and wait/notify
  6. 12:19Smart pointers and atomics
  7. 14:08Atomic reference guarantees
  8. 16:55Semaphores and producer-consumer
  9. 20:16Why avoid condition variables
  10. 27:48Ping-pong sync performance
  11. 34:26Choosing between atomics, semaphores, and condition variables
  12. 36:12Barriers and latches
  13. 39:25Barrier use cases
  14. 42:10Cooperative interruption
  15. 47:16Stop tokens in practice
  16. 51:24Improved std::thread
  17. 54:06Synchronized output streams
  18. 55:54Summary
  19. 56:15Q&A
~/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.