Real time 101
summary
A practical flowchart maps real constraints to patterns: use an atomic for tiny state, a spinlock when big data can be missed, a null-pointer compare-and-swap loop (the compare_exchange trick) to swap resources without leaks, and double-buffering with ring buffer variants when the real-time thread produces values. The library on GitHub collects these patterns as early alpha; the general FIFO is 60% slower than Boost for the most general case. Tooling recommendations: thread sanitizer, s‑trace and LD_PRELOAD for syscall/allocation detection.
AI-written summary · about
chapters (24)
- 0:00Intro
- 1:35How Hard is Hard?
- 3:04Real-time Threads
- 3:39Problems to Real-time
- 5:39Making Copies
- 5:56Hidden Copies
- 6:34Blocking vs. Non-wait-free vs. Wait Free
- 7:27In Summary
- 8:01The farbot Library
- 12:40atomic Summary
- 15:28Basic spin_lock
- 17:39The CAS Exchange Loop
- 20:54farbot's NonRealtimeMutatable
- 21:54Non-real-time Mutate Summary
- 22:50Non-real-time Mutating?
- 23:05Double Buffering
- 26:38farbot's RealtimeMutatable
- 27:55Sharing or Passing?
- 29:14Which FIFO is right for you?
- 33:57Farbot's AsyncCaller
- 34:54FIFO Summary
- 35:41Mutating on realtime and non-realtime
- 37:51Real-time & Non-real-time Summary
- 39:37How to Debug
related talks
52mBest Practices for Concurrency
01h 03m...Scaling Visualization in concurrent C++ programs
01h 07mAn Introduction to Multithreading in C++20
59mThreads and Locks must Go
30mFearless concurrency in your microcontroller
01h 00mLock-Free Programming (or, Juggling Razor Blades), Part I
49mThread Pool Elements
55mC++ in the World of Embedded Systems
