Are there Time-Bombs in your Realtime Code?
summary
Many common RT sync tricks silently break: compilers can turn a 64-bit access into two instructions, structure packing or bus/DMA can remove apparent atomicity, and read-modify-write (+ =) is not atomic. Disabling interrupts only protects a single core, and double-buffering fails on multi‑core because other cores can observe mixed updates; priority inheritance can reorder access. Volatile is not synchronization, delays are time‑bombs, and std::atomic behaves differently across platforms with some using loops and barriers so interrupt‑disable only works on single core.
AI-written summary · about
chapters (21)
- 0:00Introduction and speaker background
- 1:49Overconfidence in real-time programming
- 3:59Severity of bugs in production
- 5:23Race conditions and atomicity basics
- 7:13Single-instruction atomicity pitfalls
- 10:48Time bombs in hidden assumptions
- 12:37Native-size atomicity and alignment
- 16:08Atomicity beyond CPU cores
- 19:24Volatile and compiler behavior
- 20:29Read-modify-write atomicity issues
- 21:34Atomicity of multiple variables
- 23:22Double buffering and multicore risks
- 26:40Preemptive scheduling explained
- 31:39Priority inversion and inheritance
- 36:16Disabling interrupts for atomicity
- 39:52Limitations of interrupt masking
- 40:32Using delays as a workaround
- 43:48Modern C++ std::atomic library
- 47:12Platform-specific atomic implementations
- 51:12Portability and future-proofing code
- 52:17Summary and Q&A
