Synthesizing fine-grained synchronization protocols for implicit monitors
Open Access
- 29 April 2022
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 6 (OOPSLA1) , 1-26
Abstract
A monitor is a widely-used concurrent programming abstraction that encapsulates all shared state between threads. Monitors can be classified as being either implicit or explicit depending on the primitives they provide. Implicit monitors are much easier to program but typically not as efficient. To address this gap, there has been recent research on automatically synthesizing explicit-signal monitors from an implicit specification, but prior work does not exploit all paralellization opportunities due to the use of a single lock for the entire monitor. This paper presents a new technique for synthesizing fine-grained explicit-synchronization protocols from implicit monitors. Our method is based on two key innovations: First, we present a new static analysis for inferring safe interleavings that allow violating mutual exclusion of monitor operations without changing its semantics. Second, we use the results of this static analysis to generate a MaxSAT instance whose models correspond to correct-by-construction synchronization protocols. We have implemented our approach in a tool called Cortado and evaluate it on monitors that contain parallelization opportunities. Our evaluation shows that Cortado can synthesize synchronization policies that are competitive with, or even better than, expert-written ones on these benchmarks.Keywords
All Related Versions
Funding Information
- NSF (CCF-1918889,CCF-1811865)
- U.S. Department of Energy (SC0021110)
This publication has 14 references indexed in Scilit:
- SeaHorn: A Framework for Verifying C Programs (Competition Contribution)2015
- Inferring locks for atomic sectionsACM SIGPLAN Notices, 2008
- Lock allocation2007
- Autolocker2006
- Monitor classificationACM Computing Surveys, 1995
- A safe approximate algorithm for interprocedural aliasingACM SIGPLAN Notices, 1992
- Covering graphs by the minimum number of equivalence relationsCombinatorica, 1986
- Experience with processes and monitors in MesaCommunications of the ACM, 1980
- ReductionCommunications of the ACM, 1975
- MonitorsCommunications of the ACM, 1974