Open Access
- 6 June 2023
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 7 (PLDI) , 712-735
Abstract
Many concurrent programs assign priorities to threads to improve responsiveness. When used in conjunction with synchronization mechanisms such as mutexes and condition variables, however, priorities can lead to priority inversions, in which high-priority threads are delayed by low-priority ones. Priority inversions in the use of mutexes are easily handled using dynamic techniques such as priority inheritance, but priority inversions in the use of condition variables are not well-studied and dynamic techniques are not suitable. In this work, we use a combination of static and dynamic techniques to prevent priority inversion in code that uses mutexes and condition variables. A type system ensures that condition variables are used safely, even while dynamic techniques change thread priorities at runtime to eliminate priority inversions in the use of mutexes. We prove the soundness of our system, using a model of priority inversions based on cost models for parallel programs. To show that the type system is practical to implement, we encode it within the type systems of Rust and C++, and show that the restrictions are not overly burdensome by writing sizeable case studies using these encodings, including porting the Memcached object server to use our C++ implementation.Keywords
All Related Versions
Funding Information
- National Science Foundation (CCF-2107289, CCF-1910568, CCF-1943456, CCF-2107280, CCF-1901381, CCF-2115104, CCF-2119352, CCF-2107241, CCF-2216971, and CCF-2106699)
This publication has 26 references indexed in Scilit:
- A type system for borrowing permissions2012
- A formalization of priority inversionReal-Time Systems, 1993
- Priority inheritance protocols: an approach to real-time synchronizationIEEE Transactions on Computers, 1990
- Speedup versus efficiency in parallel systemsIEEE Transactions on Computers, 1989
- Priority inversion in AdaACM SIGAda Ada Letters, 1987
- Linear logicTheoretical Computer Science, 1987
- MULTILISP: a language for concurrent symbolic computationACM Transactions on Programming Languages and Systems, 1985
- Implementation of multilisp1984
- Experience with processes and monitors in MesaCommunications of the ACM, 1980
- The Parallel Evaluation of General Arithmetic ExpressionsJournal of the ACM, 1974