~/talk

An Introduction to Multithreading in C++20

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

C++20 gives concrete tools not platitudes: use std::jthread with std::stop_token for managed threads (destructor requests stop then joins), prefer parallel algorithms for bulk data, use a threadpool when tasks fit (no standard one yet), and synchronize with latch/barrier/future before falling back to mutex + condition_variable; semaphores for slot counting; atomics only when necessary. The talk demonstrates stop callbacks canceling blocking I/O and shows ordering of choices that preserve scalability and correctness.

AI-written summary · about

  1. 0:00Introduction
  2. 0:52Agenda
  3. 1:15Why Multithreading
  4. 3:30Amdahls Law
  5. 5:54Parallel Algorithms
  6. 8:30Thread Pools
  7. 10:50Starting and Managing Threads
  8. 11:05Cancelling Threads
  9. 12:56Stop Requests
  10. 14:23Stoppable
  11. 15:12StopCallback
  12. 17:49JThread
  13. 20:32Destructor
  14. 21:40Thread
  15. 22:11References
  16. 22:40Structure semantics
  17. 23:15Stop source
  18. 23:41Stop source API
  19. 24:06Communication
  20. 24:24Data Race
  21. 25:24Latch
  22. 26:22Constructor
  23. 26:43Functions
  24. 28:07Tests
  25. 29:59Barrier
  26. 30:10Structural Barrier
  27. 31:22Template
  28. 32:29Completion Function
  29. 33:24Barrier Function
  30. 34:07Futures
  31. 34:19Promise
  32. 35:10Future
  33. 35:56Waiting
  34. 37:24Promises
  35. 38:11Exception
  36. 38:41Async
  37. 40:12Shared Future
  38. 40:50Mutex
  39. 43:12Does it work
  40. 44:19Explicit destruction
  41. 44:33Deadlock
  42. 44:52Waiting for data
  43. 45:09Busy wait
  44. 45:53Unique lock
  45. 47:58Notification
  46. 50:22Semaphore
  47. 52:03Number of Slots
  48. 52:48Atomics
  49. 54:21LockFree
  50. 55:14Summary
~/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.