Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Synthesizing fine-grained synchronization protocols for implicit monitors

Published: 29 April 2022 Publication History

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.

References

[1]
Noga Alon. 1986. Covering graphs by the minimum number of equivalence relations. Combinatorica, 6, 3 (1986), Sep, 201–206. issn:1439-6912 https://doi.org/10.1007/BF02579381
[2]
Andrew D Birrell. 1989. An introduction to programming with threads. Digital Systems Research Center, Palo Alto, California.
[3]
Peter A. Buhr, Michel Fortier, and Michael H. Coffin. 1995. Monitor Classification. ACM Comput. Surv., 27, 1 (1995), mar, 63–107. issn:0360-0300 https://doi.org/10.1145/214037.214100
[4]
Sigmund Cherem, Trishul Chilimbi, and Sumit Gulwani. 2008. Inferring Locks for Atomic Sections. SIGPLAN Not., 43, 6 (2008), jun, 304–315. issn:0362-1340 https://doi.org/10.1145/1379022.1375619
[5]
Leonardo de Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In Tools and Algorithms for the Construction and Analysis of Systems, C. R. Ramakrishnan and Jakob Rehof (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 337–340. isbn:978-3-540-78800-3
[6]
Michael Emmi, Jeffrey S. Fischer, Ranjit Jhala, and Rupak Majumdar. 2007. Lock allocation. In Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2007, Nice, France, January 17-19, 2007. Association for Computing Machinery, New York, NY, USA. 291–296. https://doi.org/10.1145/1190216.1190260
[7]
Kostas Ferles, Benjamin Sepanski, Rahul Krishnan, James Bornholt, and Isil Dillig. 2022. Synthesizing Fine-Grained Synchronization Protocols for Implicit Monitors (Extended Version). arxiv:2203.00783.
[8]
Kostas Ferles, Jacob Van Geffen, Isil Dillig, and Yannis Smaragdakis. 2018. Symbolic Reasoning for Automatic Signal Placement. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2018). Association for Computing Machinery, New York, NY, USA. 120–134. isbn:9781450356985 https://doi.org/10.1145/3192366.3192395
[9]
GitHub. 2022. GitHub REST API. https://docs.github.com/en/rest
[10]
Guy Golan-Gueta, Nathan Bronson, Alex Aiken, G. Ramalingam, Mooly Sagiv, and Eran Yahav. 2011. Automatic Fine-Grain Locking Using Shape Properties. SIGPLAN Not., 46, 10 (2011), oct, 225–242. issn:0362-1340 https://doi.org/10.1145/2076021.2048086
[11]
Arie Gurfinkel, Temesghen Kahsai, and Jorge A. Navas. 2015. SeaHorn: A Framework for Verifying C Programs Competition Contribution. In Proceedings of the 21st International Conference on Tools and Algorithms for the Construction and Analysis of Systems - Volume 9035. Springer-Verlag, Berlin, Heidelberg. 447–450. isbn:9783662466803 https://doi.org/10.1007/978-3-662-46681-0_41
[12]
Richard L. Halpert, Christopher J. F. Pickett, and Clark Verbrugge. 2007. Component-Based Lock Allocation. In Proceedings of the 16th International Conference on Parallel Architecture and Compilation Techniques (PACT ’07). IEEE Computer Society, USA. 353–364. isbn:0769529445
[13]
Per Brinch Hansen. 1973. Operating System Principles. Prentice-Hall, Englewood Cliffs, New Jersey. isbn:0-13-637843-9
[14]
Michael Hicks, Jeffrey S Foster, and Polyvios Pratikakis. 2006. Lock inference for atomic sections. In On-Line Proceedings of the First ACM SIGPLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing (TRANSACT). http://www.cs.purdue.edu/homes/jv/events/TRANSACT/transact-06.tgz
[15]
C. A. R. Hoare. 1971. Towards a theory of parallel programming. In Operating Systems Techniques, Proceedings of a Seminar at Queen’s University, Belfast. Springer-Verlag, Belfast, Northern Ireland. 231–244. isbn:0387954015
[16]
C. A. R. Hoare. 1974. Monitors: An Operating System Structuring Concept. Commun. ACM, 17, 10 (1974), oct, 549–557. issn:0001-0782 https://doi.org/10.1145/355620.361161
[17]
Wei-Lun Hung and Vijay K. Garg. 2013. AutoSynch: An Automatic-Signal Monitor Based on Predicate Tagging. SIGPLAN Not., 48, 6 (2013), jun, 253–262. issn:0362-1340 https://doi.org/10.1145/2499370.2462175
[18]
Butler W. Lampson and David D. Redell. 1980. Experience with Processes and Monitors in Mesa. Commun. ACM, 23, 2 (1980), feb, 105–117. issn:0001-0782 https://doi.org/10.1145/358818.358824
[19]
William Landi and Barbara G. Ryder. 1992. A Safe Approximate Algorithm for Interprocedural Aliasing. SIGPLAN Not., 27, 7 (1992), July, 235–248. issn:0362-1340 https://doi.org/10.1145/143103.143137
[20]
Richard J. Lipton. 1975. Reduction: A Method of Proving Properties of Parallel Programs. Commun. ACM, 18, 12 (1975), dec, 717–721. issn:0001-0782 https://doi.org/10.1145/361227.361234
[21]
Bill McCloskey, Feng Zhou, David Gay, and Eric Brewer. 2006. Autolocker: Synchronization Inference for Atomic Sections. In Conference Record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’06). Association for Computing Machinery, New York, NY, USA. 346–358. isbn:1595930272 https://doi.org/10.1145/1111037.1111068
[22]
T. S. Michael and Thomas Quint. 2006. Sphericity, Cubicity, and Edge Clique Covers of Graphs. Discrete Appl. Math., 154, 8 (2006), may, 1309–1313. issn:0166-218X
[23]
Aleksey Shipilev, Sergey Kuksenko, Astrand Astrand, Staffan Freiberg, and Henrik Loef. 2021. OpenJDK: jmh. http://openjdk.java.net/projects/code-tools/jmh/
[24]
Raja Vallée-Rai, Phong Co, Etienne Gagnon, Laurie Hendren, Patrick Lam, and Vijay Sundaresan. 1999. Soot-a Java bytecode optimization framework. In Proceedings of the 1999 conference of the Centre for Advanced Studies on Collaborative research. IBM Press, Mississauga, Ontario, Canada. 13.

Cited By

View all
  • (2024)The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and EfficientlyProceedings of the ACM on Programming Languages10.1145/36898038:OOPSLA2(2606-2632)Online publication date: 8-Oct-2024

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 6, Issue OOPSLA1
April 2022
687 pages
EISSN:2475-1421
DOI:10.1145/3534679
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 29 April 2022
Published in PACMPL Volume 6, Issue OOPSLA1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. concurrent programming
  2. fine-grained locking
  3. implicit signal monitors
  4. monitor invariant
  5. symbolic reasoning
  6. verification conditions

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)70
  • Downloads (Last 6 weeks)13
Reflects downloads up to 10 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and EfficientlyProceedings of the ACM on Programming Languages10.1145/36898038:OOPSLA2(2606-2632)Online publication date: 8-Oct-2024

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media