Bounded Priority-Aware Locking for Real-Time Kernels
Pith reviewed 2026-06-29 13:57 UTC · model grok-4.3
The pith
Batched Priority Lock groups tasks by request order then grants to the highest priority within each group.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
BPL first groups waiting tasks based on the order of their lock requests, and then determines the next lock holder according to priority within the waiting group. This approach achieves the same waiting bound as FIFO locks while reducing average waiting time for higher priority tasks.
What carries the argument
The Batched Priority Lock mechanism that batches lock requests by arrival order and selects the highest-priority waiter inside each batch.
If this is right
- BPL maintains the same worst-case lock waiting bound as FIFO ordering.
- Higher priority tasks experience lower average waiting times than under FIFO.
- Unlike strict priority locking, BPL prevents starvation and unbounded delays.
- The common-case overhead remains low enough for use in an 8-core real-time operating system.
- Performance holds in simulations scaling to 64 cores.
Where Pith is reading between the lines
- Similar batching could apply to other synchronization primitives beyond spinlocks.
- The approach may improve overall system schedulability by reducing interference on high-priority tasks.
- Implementation details like batch size limits could be tuned for specific hardware.
Load-bearing premise
Selecting the highest-priority task within each arrival batch can be performed without introducing additional synchronization delays that break the real-time timing model.
What would settle it
An experiment measuring worst-case lock acquisition latency under heavy contention on a multicore platform where BPL exceeds the FIFO bound.
Figures
read the original abstract
A real-time multicore system requires delay bounds on access to shared resources. These resources include the kernel, which has potentially many non-preemptible critical sections guarded by one or more different synchronization primitives. While primitives such as FIFO locks bound the waiting time to enter a critical section, they do not distinguish the importance of individual tasks competing for shared resource access. To address this, we consider a priority-aware spinlock, which reduces the average delay of more important tasks while maintaining a worst-case bound on lock waiting time. We propose a Batched Priority Lock (BPL) that first groups waiting tasks based on the order of their lock requests, and then determines the next lock holder according to priority within the waiting group. We compare BPL to alternative lock approaches, showing that the average waiting time is reduced for higher priority tasks, in simulations up to 64 cores, and for a working implementation on an 8-core machine with a real RTOS. BPL is a compromise between strict priority and FIFO ordering. While strict priorities may lead to starvation and, hence, unbounded lock acquisition delays, BPL has the same waiting bound as FIFO, but with benefits to higher priority tasks. Although its complexity is greater than that of a simple spinlock, its common case execution overhead is shown to be inexpensive in a working system. We believe this is an acceptable cost in systems that require predictability.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes the Batched Priority Lock (BPL), a spinlock that groups waiting tasks by arrival order and then grants the lock to the highest-priority task within each group. It claims this yields the same worst-case waiting bound as FIFO locks while reducing average delay for higher-priority tasks, supported by simulations on up to 64 cores and an 8-core implementation on a real RTOS.
Significance. If the batch-internal priority selection can be realized without introducing synchronization delays beyond those of a plain FIFO lock, BPL would offer a practical middle ground between strict priority (risking starvation) and FIFO for real-time kernels. The empirical evaluation on real hardware is a concrete strength; however, the absence of a formal bound derivation or detailed timing analysis for the selection step limits the result's immediate applicability to certified real-time systems.
major comments (2)
- [Abstract] Abstract (BPL definition paragraph): the claim that BPL 'has the same waiting bound as FIFO' rests on the unstated assumption that selecting the highest-priority waiter inside an arrival-order batch can be performed with bounded, contention-free latency; no data structures, atomic primitives, or critical-section timing analysis are supplied to substantiate this.
- [Abstract] Abstract (simulation and implementation claims): the bounded-wait result is asserted on the basis of simulations to 64 cores and an 8-core RTOS implementation, yet no error bars, outlier exclusion criteria, or worst-case measurement methodology are described, leaving the central empirical support for the FIFO-equivalent bound unexamined.
minor comments (1)
- [Abstract] The abstract refers to 'common case execution overhead' without quantifying it relative to a baseline FIFO spinlock or stating the measurement conditions.
Simulated Author's Rebuttal
We thank the referee for the thoughtful and constructive report. We address each major comment below and will make the requested revisions to improve the clarity and rigor of the presentation.
read point-by-point responses
-
Referee: [Abstract] Abstract (BPL definition paragraph): the claim that BPL 'has the same waiting bound as FIFO' rests on the unstated assumption that selecting the highest-priority waiter inside an arrival-order batch can be performed with bounded, contention-free latency; no data structures, atomic primitives, or critical-section timing analysis are supplied to substantiate this.
Authors: We agree that the abstract (and the manuscript) does not supply the requested implementation details or timing analysis to substantiate the bounded-latency claim for intra-batch selection. The current text simply asserts the FIFO-equivalent bound without describing the data structures or primitives. We will revise the paper to include a description of the queue and selection mechanism together with a timing analysis demonstrating that the selection step executes with bounded, contention-free latency that does not increase the worst-case waiting bound beyond that of FIFO. revision: yes
-
Referee: [Abstract] Abstract (simulation and implementation claims): the bounded-wait result is asserted on the basis of simulations to 64 cores and an 8-core RTOS implementation, yet no error bars, outlier exclusion criteria, or worst-case measurement methodology are described, leaving the central empirical support for the FIFO-equivalent bound unexamined.
Authors: We acknowledge that the reported simulation and implementation results lack the methodological details needed to fully evaluate the bounded-wait claims. In the revised version we will add error bars to the simulation figures, describe the outlier exclusion criteria, and provide a clear account of the worst-case measurement methodology (including number of trials, workload generation, and how maximum observed waits were recorded). revision: yes
Circularity Check
No significant circularity; bound claim follows from explicit design definition
full rationale
The paper presents BPL as an algorithmic construction that batches waiters by arrival order then selects the highest-priority task inside each batch. The claim that this yields the same worst-case waiting bound as FIFO is a direct consequence of the batching rule (which preserves arrival-order progress) rather than any fitted parameter, self-citation chain, or equation that reduces the bound to its own inputs. No equations, uniqueness theorems, or prior-author citations are invoked to derive the bound; the result is self-contained against the stated mechanism. The implementation assumption about selection latency is a correctness concern, not a circularity in the derivation.
Axiom & Free-Parameter Ledger
axioms (2)
- domain assumption Real-time tasks possess static or known priorities that the lock can inspect at acquisition time.
- domain assumption The kernel critical sections are short and non-preemptible, so lock contention is the dominant source of delay.
invented entities (1)
-
Batched Priority Lock (BPL)
no independent evidence
Reference graph
Works this paper leans on
-
[1]
Sara Afshar, Moris Behnam, Reinder J. Bril, and Thomas Nolte. 2017. An Optimal Spin-Lock Priority Assignment Algorithm for Real-Time Multi-core Systems. In 2017 IEEE 23rd International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA) . IEEE, USA, 1–11. doi:10.1109/RTCSA.2017.8046310
-
[2]
Brandenburg
Björn B. Brandenburg. 2020. Multiprocessor Real-Time Locking Protocols. Springer Singapore, Singapore, 1–99. doi:10. 1007/978-981-4585-87-3_10-1
2020
-
[3]
Björn B. Brandenburg and James H. Anderson. 2010. Optimality Results for Multiprocessor Real-Time Locking. In 2010 31st IEEE Real-Time Systems Symposium . IEEE, USA, 49–60. doi:10.1109/RTSS.2010.17
-
[4]
Cincoze. [n. d.]. DX-1100 PC, Cincoze. https://www.cincoze.com/goods_info.php?id=286
-
[5]
SimPy Contributors. [n. d.]. https://simpy.readthedocs.io/
-
[6]
Jonathan Corbet. 2014. MCS locks and qspinlocks. https://lwn.net/Articles/590243/
2014
-
[7]
Travis S. Craig. 1993. Queuing Spin lock Algorithms to Support Timing Predictability. In 1993 Proceedings Real-Time Systems Symposium (RTSS ’93) . IEEE, USA, 148–157. doi:10.1109/REAL.1993.393505
-
[8]
Matthew Danish, Ye Li, and Richard West. 2011. Virtual-CPU Scheduling in the Quest Operating System. In2011 17th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS ’11) . IEEE, USA, 169–179. doi:10.1109/ RTAS.2011.24
2011
-
[9]
Tudor David, Rachid Guerraoui, and Vasileios Trigonakis. 2013. Everything You Always Wanted to Know About Syn- chronization but Were Afraid to Ask. In2013 24th ACM Symposium on Operating Systems Principles (SOSP). Association for Computing Machinery, New York, NY, USA, 33–48. doi:10.1145/2517349.2522714
-
[10]
Steven Fuerst. 2011. Priority Spin Locks. https://locklessinc.com/articles/priority_locks/
2011
-
[11]
2008.Concurrency at Microsoft - An Exploratory Survey
Patrice Godefroid and Nachi Nagappan. 2008.Concurrency at Microsoft - An Exploratory Survey. Technical Report MSR- TR-2008-75. Microsoft. 4 pages. https://www.microsoft.com/en-us/research/publication/concurrency-at-microsoft- an-exploratory-survey/
2008
-
[12]
Chien-Chung Huang and Prasad Jayanti. 2016. Priority Mutual Exclusion: Specification and Algorithm. InProceedings of the 30th International Symposium on Distributed Computing (DISC ’16) . Springer, Berlin, Heidelberg, 385–398
2016
-
[13]
Prasad Jayanti. 2003. Adaptive and Efficient Abortable Mutual Exclusion. InProceedings of the Twenty-Second Annual Symposium on Principles of Distributed Computing (Boston, Massachusetts)(PODC ’03) . Association for Computing Machinery, New York, NY, USA, 295–304. doi:10.1145/872035.872079
-
[14]
Theodore Johnson and Krishna Harathi. 1997. A Prioritized Multiprocessor Spin Lock.IEEE Transactions on Parallel and Distributed Systems 8, 9 (1997), 926–933. doi:10.1109/71.615438
-
[15]
David G. Kendall. 1953. Stochastic Processes Occurring in the Theory of Queues and their Analysis by the Method of the Imbedded Markov Chain. The Annals of Mathematical Statistics 24, 3 (1953), 338 – 354. doi:10.1214/aoms/ 1177728975
-
[16]
Chung L. Liu and James W. Layland. 1973. Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Envi- ronment. J. ACM 20, 1 (Jan 1973), 46–61. doi:10.1145/321738.321743
-
[17]
J. W. S. Liu, K. J. Lin, W. K. Shih, A. C. S. Yu, J. Y. Chung, and W. Zhao. 1991. Algorithms for Scheduling Imprecise Computations. Computer 24, 5 (May 1991), 58–68. doi:10.1109/2.76287
-
[18]
Jane W. S. Liu, Wei Kuan Shih, Kwei-Jay Lin, Riccardo Bettati, and Jen-Yao Chung. 1994. Imprecise Computations. Proc. IEEE 82 (1994), 83–94. https://api.semanticscholar.org/CorpusID:267916812
1994
-
[19]
Magnusson, Anders Landin, and Erik Hagersten
Peter S. Magnusson, Anders Landin, and Erik Hagersten. 1994. Queue Locks on Cache Coherent Multiprocessors. In Proceedings of 8th International Parallel Processing Symposium (IPPS ’94) . IEEE, USA, 165–171. doi:10.1109/IPPS.1994. 288305
-
[20]
Marathe, Mark Moir, and Nir Shavit
Virendra J. Marathe, Mark Moir, and Nir Shavit. 2006. Composite Abortable Locks. InProceedings 20th IEEE Interna- tional Parallel & Distributed Processing Symposium (IPDPS ’06) . IEEE, USA, 1–10. doi:10.1109/IPDPS.2006.1639367
-
[21]
Evangelos P. Markatos. 1991. Multiprocessor Synchronization Primitives with Priorities. IFAC Proceedings Volumes 24, 2 (1991), 1–6. doi:10.1016/S1474-6670(17)51259-8 IFAC/IFIP Workshop on Real Time Programming, Atlanta, GA, USA, 15-17 May 1991
-
[22]
José Martins, Adriano Tavares, Marco Solieri, Marko Bertogna, and Sandro Pinto. 2020. Bao: A Lightweight Static Par- titioning Hypervisor for Modern Multi-Core Embedded Systems. InWorkshop on Next Generation Real-Time Embedded Systems (NG-RES 2020) (Open Access Series in Informatics (OASIcs), Vol. 77) , Marko Bertogna and Federico Terraneo (Eds.). Schloss...
-
[23]
John M. Mellor-Crummey and Michael L. Scott. 1991. Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors. ACM Trans. Comput. Syst. 9, 1 (Feb 1991), 21–65. doi:10.1145/103727.103729
-
[24]
Jiannan Ouyang and John R. Lange. 2013. Preemptable Ticket Spinlocks: Improving Consolidated Performance in the Cloud. In Proceedings of the 9th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments (Houston, Texas, USA)(VEE ’13). Association for Computing Machinery, New York, NY, USA, 191–200. doi:10.1145/ J. ACM, Vol. 37, No. 4, ...
-
[25]
Sean Peters, Adrian Danis, Kevin Elphinstone, and Gernot Heiser. 2015. For a Microkernel, a Big Lock Is Fine. In2015 6th Asia-Pacific Workshop on Systems (APSys ’15) (Tokyo, Japan). Association for Computing Machinery, New York, NY, USA, Article 3, 7 pages. doi:10.1145/2797022.2797042
- [26]
-
[27]
Ragunathan Rajkumar, Lui Sha, and John P. Lehoczky. 1988. Real-Time Synchronization Protocols for Multiprocessors. In 1988 9th IEEE International Real-Time Systems Symposium (RTSS ’88) . IEEE, USA, 259–269. doi:10.1109/REAL.1988. 51121
-
[28]
Michael L. Scott and William N. Scherer. 2001. Scalable Queue-based Spin Locks with Timeout. In Proceedings of the Eighth ACM SIGPLAN Symposium on Principles and Practices of Parallel Programming (Snowbird, Utah, USA) (PPoPP ’01). Association for Computing Machinery, New York, NY, USA, 44–52. doi:10.1145/379539.379566
-
[29]
Baker, An-I Wang, and Michael Gonzalez Harbour
Mark Stanovich, Theodore P. Baker, An-I Wang, and Michael Gonzalez Harbour. 2010. Defects of the POSIX Sporadic Server and How to Correct Them. In2010 16th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS ’10). IEEE, USA, 35–45. doi:10.1109/RTAS.2010.34
-
[30]
Richard West, Ye Li, Eric Missimer, and Matthew Danish. 2016. A Virtualized Separation Kernel for Mixed-Criticality Systems. ACM Trans. Comput. Syst. 34, 3, Article 8 (June 2016), 41 pages. doi:10.1145/2935748 J. ACM, Vol. 37, No. 4, Article 111. Publication date: August 2018
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.