~/talk

Back to Basics: Concurrency

Talkat CppCon 2021 · on Monday, 2021-10-25· at 16:45· D) Valley 1, online· [web-performance]
slides:none on file

Gentle, example‑driven tour of modern C++ concurrency that actually shows code and failures: uses std::thread and jthread, demonstrates data races with 1000 threads, fixes them with mutex/lock_guard/scoped_lock and then shows a cleaner option with std::atomic. Shows deadlock, how exceptions can leak locks, and a working async buffered file loader using async/future/promise that prints interleaved progress. Also mentions pthread linking, thread sanitizers, and why thousands of threads don’t automatically equal speed.

AI-written summary · about

  1. 0:00Start
  2. 0:48Who Am I
  3. 1:04Foundations of Concurrency
  4. 1:49Motivation
  5. 3:55Performance Is the Currency of Computing
  6. 4:37What Is Concurrency
  7. 6:35A Memory Allocator
  8. 8:08Architecture History
  9. 9:35Dennard Scaling
  10. 13:43When Should We Be Using Threads
  11. 14:57C plus Standard Thread Library
  12. 15:52The Standard Thread Library
  13. 16:16First Thread Example
  14. 17:37Thread Join
  15. 27:28Pitfalls of Concurrent Programming
  16. 28:32Interleaving of Instructions
  17. 28:53Data Race
  18. 29:29Mutex
  19. 31:06Mutual Exclusion
  20. 31:55What Happens if the Lock Is Never Returned
  21. 32:18Deadlock
  22. 33:05Fix Deadlock
  23. 35:06Lock Guard
  24. 36:46Scope Lock
  25. 40:31Condition Variable
  26. 41:45Thread Reporter
  27. 43:21Unique Lock
  28. 44:29Recap
  29. 45:52Asynchronous Programming
  30. 46:24Async
  31. 50:56Buffered File Loading
  32. 52:51Thread Sanitizers
  33. 54:09Co-Routines
  34. 54:49Memory Model
  35. 55:17Common Concurrency Patterns
  36. 56:05Producer Consumer
  37. 57:34Parallel Algorithms
  38. 59:10Further Resources
~/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.