~/talk

std::jthread - I Told You Concurrency Is Tricky

Talkat ACCU 2021 Online · 2021-03-10..03-13· [concurrency]
slides:none on file

C++ gains a practical thread type that auto-joins on destruction and adds cooperative cancellation: the team implements std::jthread with a paired stop_token/stop_source and a condition_variable_any interruptible wait. Implementers use stop callbacks, move-safe token copies, and inner mutexes to avoid deadlocks and races; early bugs include tokens moved out of members and lock-order deadlocks, both fixed. The design ships in C++20 and works for typical threaded and condition-variable use.

AI-written summary · about

  1. 0:00Start
  2. 1:06Disclaimer
  3. 14:40The Design
  4. 19:36Cooperative Cancellation of a Threat
  5. 21:49Options To Cancel a Threat
  6. 37:11General Api
  7. 43:35Condition Variables
  8. 1:05:07Condition Variable
  9. 1:08:24Deadlock
  10. 1:11:36Change the Order of Unlocks by Move by Creating a New Lock Guard
  11. 1:26:31What Would Happen if the Callback Fades To Be Registered due to Running out of Heat Memory
  12. 1:26:47What Happens to the Stop Callbacks When J Threat Detached His Call
~/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.