Lock allocation
Michael Emmi, Jeffrey S. Fischer, Ranjit Jhala et al. · ACM SIGPLAN Notices · 2007
We introduce lock allocation , an automatic technique that takes a multi-threaded program annotated with atomic sections (that must be executed atomically), and infers a lock assignment from global variables to locks and a lock instrumentation that determines where each lock should be acquired and released such that the resulting instrumented program is guaranteed to preserve atomicity and deadlock freedom (provided all shared state is accessed only within atomic sections). Our algorithm works in the presence of pointers and procedures, and sets up the lock allocation problem as a 0-1 ILP which minimizes the conflict cost between atomic sections while simultaneously minimizing the number of locks. We have implemented our algorithm for both C with pthreads and Java, and have applied it to infer locks in 15K lines of AOLserver code. Our automatic allocation produces the same results as hand annotations for most of this code, while solving the optimization instances within a second for most programs.
Cited by 66 works. doi:10.1145/1190215.1190260
Authors
References
- Transaction Processing: Concepts and Techniques
- The model checker SPIN
- Eraser
- CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs
- Program Analysis and Specialization for the C Programming Language
- Language support for lightweight transactions
- The SPIN Model Checker
- Type-based race detection for Java
- Language support for lightweight transactions
- Process structuring, synchronization, and recovery using atomic actions