Ticket Spinlocks in Zephyr RTOS: What, Where & Why
summary
Zephyr replaces a simple atomic flag spinlock with ticket spinlocks and adds a fairness test; simulated runs on a Synopsys simulator expose a livelock caused by deterministic instruction batching, and a four-core board shows one core grabbing almost all locks while others starve; ticket spinlocks restore per-core fairness in both simulator and hardware but host scheduling and virtualization can still skew acquisition order; the implementation is available but marked experimental while work continues on atomic packing and corner cases.
AI-written summary · about
chapters (8)
- 0:00Ticket spinlocks in Zephyr
- 4:21Spinlock fairness problem
- 10:04Detecting unfairness with tests
- 14:24How ticket spinlocks ensure fairness
- 22:26Performance impact of ticket spinlocks
- 27:08Pitfalls in ticket spinlocks
- 28:59Status and future in Zephyr
- 32:01Q&A
related talks
37mTicket Spinlocks in Zephyr RTOS: What, Where & Why
35mMulti-core Application Development with Zephyr RTOS
35mMulti-core Application Development with Zephyr RTOS
17m60 Adaptive userspace spinlocks with rseq
01h 38mLock-free Programming is Dead - Long Live Lock-free Programming!
41mTurning the Ignition on Safety: Zephyr RTOS in Automotive Compliance
42mInter Process Confusion - Navigating Zephyr's IPC APIs
15mRON: One-Way Circular Shortest Routing to Achieve Efficient and Bounded-waiting Spinlocks
