~/talk

Work Contracts - Rethinking Task Based Concurrency & Parallelism for Low Latency C++

Talkat CppCon 2024 · on Sunday, 2024-09-15· [rust]
links:none on file
slides:none on file

Work Contracts replaces task queues with a compact, lock‑free (often wait‑free) signal tree that lets threads traverse different branches to claim work. Benchmarks run with up to 16 threads and 16k queued items show scaling at high contention (17 ns tasks) with roughly 40x faster throughput versus moodycamel and ~100x versus average MPMC queues, using about half the memory. Contracts hold logic (repeatable calls), offer single-threaded execution per contract, support async deterministic destruction, and pair naturally with SPSC data queues; the implementation is built and benchmarked, and the numbers are concrete.

AI-written summary · about

  1. 0:00Introduction
  2. 0:26Problems with task queues
  3. 1:29Decoupling logic and data
  4. 4:54Introduction to work contracts
  5. 6:00Signal tree structure
  6. 7:40Benchmark setup
  7. 9:07Performance results
  8. 13:06Low contention benchmark
  9. 15:23Medium contention benchmark
  10. 16:25High contention benchmark
  11. 17:24Empty task benchmark
  12. 18:15Signal tree advantages
  13. 20:43Perfect binary tree
  14. 21:49Setting a signal
  15. 22:56Selecting a signal
  16. 24:50Task selection bias
  17. 26:40Task selection fairness
  18. 27:48Prioritization mechanism
  19. 28:34Prioritization summary
  20. 29:32Work contract overview
  21. 30:17Hello world example
  22. 32:34State and destructors
  23. 33:19Asynchronous destruction
  24. 35:02Error handling
  25. 35:38Repeatable invocation
  26. 36:08Data handling
  27. 38:38Single threaded guarantee
  28. 39:43Token usage
  29. 39:55Looping and destruction
  30. 42:02Threading example
  31. 42:21Parallel execution
  32. 43:16Output mangling prevention
  33. 43:37SPSC queue integration
  34. 44:24SPSC queue example
  35. 46:13Concurrency summary
  36. 46:24Conclusion
  37. 46:36Talk recap
  38. 49:32Acknowledgments
  39. 50:21Q&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.