Abstract
Explicit signaling between threads is a perennial cause of bugs in concurrent programs. While there are several run-time techniques to automatically notify threads upon the availability of some shared resource, such techniques are not widely-adopted due to their run-time overhead. This paper proposes a new solution based on static analysis for automatically generating a performant explicit-signal program from its corresponding implicit-signal implementation. The key idea is to generate verification conditions that allow us to minimize the number of required signals and unnecessary context switches, while guaranteeing semantic equivalence between the source and target programs. We have implemented our method in a tool called Expresso and evaluate it on challenging benchmarks from prior papers and open-source software. Expresso-generated code significantly outperforms past automatic signaling mechanisms (avg. 1.56x speedup) and closely matches the performance of hand-optimized explicit-signal code.
Supplemental Material
- Rahul Agarwal and Scott D. Stoller. 2006. Run-time Detection of Potential Deadlocks for Programs with Locks, Semaphores, and Condition Variables. In Proceedings of the 2006 Workshop on Parallel and Distributed Systems: Testing and Debugging (PADTAD ’06) . ACM, New York, NY, USA, 51–60. Google Scholar
Digital Library
- Aws Albarghouthi, Isil Dillig, and Arie Gurfinkel. 2016. Maximal specification synthesis. In ACM SIGPLAN Notices, Vol. 51. ACM, 789– 801. Google Scholar
Digital Library
- Gregory R. Andrews. 1991. Concurrent Programming: Principles and Practice . Benjamin-Cummings Publishing Co., Inc., Redwood City, CA, USA. Google Scholar
Digital Library
- Russell Atkinson and Carl Hewitt. {n. d.}. Synchronization in actor systems. In POPL ’77: Proc. 4th symposium on Principles of Programming Languages . ACM Press, 267–280. Google Scholar
Digital Library
- Chandrasekhar Boyapati, Robert Lee, and Martin Rinard. 2002. Ownership types for safe programming: Preventing data races and deadlocks. In ACM Sigplan Notices, Vol. 37. ACM, 211–230. Google Scholar
Digital Library
- Martin Bravenboer and Yannis Smaragdakis. 2009. Strictly Declarative Specification of Sophisticated Points-to Analyses. In ACM Symposium on Object Oriented Programming: Systems, Languages, and Applications (OOPSLA) . ACM Press, 243–262. Google Scholar
Digital Library
- Peter A Buhr, Michel Fortier, and Michael H Coffin. 1995. Monitor classification. ACM Computing Surveys (CSUR) 27, 1 (1995), 63–107. Google Scholar
Digital Library
- Peter A Buhr and Ashif S Harji. 2005. Implicit-signal monitors. ACM Transactions on Programming Languages and Systems (TOPLAS) 27, 6 (2005), 1270–1343. Google Scholar
Digital Library
- Cristiano Calcagno, Dino Distefano, Peter O’Hearn, and Hongseok Yang. 2009. Compositional shape analysis by means of bi-abduction. In ACM SIGPLAN Notices, Vol. 44. ACM, 289–300. Google Scholar
Digital Library
- Pavol Čern`y, Thomas A Henzinger, Arjun Radhakrishna, Leonid Ryzhyk, and Thorsten Tarrach. 2013. Efficient synthesis for concurrency by semantics-preserving transformations. In International Conference on Computer Aided Verification . Springer, 951–967.Google Scholar
- Sigmund Cherem, Trishul Chilimbi, and Sumit Gulwani. 2008. Inferring locks for atomic sections. In SIGPLAN Conference on Programming Language Design and Implementation (PLDI) . ACM, New York, NY, USA, 304–315. Google Scholar
Digital Library
- Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. Tools and Algorithms for the Construction and Analysis of Systems (2008), 337–340. Google Scholar
Digital Library
- Dongdong Deng, Wei Zhang, and Shan Lu. 2013. Efficient concurrencybug detection across inputs. In Acm Sigplan Notices, Vol. 48. ACM, 785–802. Google Scholar
Digital Library
- Edsger W Dijkstra. 1971. Hierarchical ordering of sequential processes. In The origin of concurrent programming. Springer, 198–227.Google Scholar
- Edsger W. Dijkstra. 2002. Cooperating Sequential Processes . Springer New York, New York, NY, 65–138. Google Scholar
Digital Library
- Isil Dillig and Thomas Dillig. 2013. Explain: a tool for performing abductive inference. In International Conference on Computer Aided Verification . Springer, 684–689.Google Scholar
Cross Ref
- Isil Dillig, Thomas Dillig, Boyang Li, and Ken McMillan. 2013. Inductive invariant generation via abductive inference. In Acm Sigplan Notices, Vol. 48. ACM, 443–456. Google Scholar
Digital Library
- Isil Dillig, Thomas Dillig, Boyang Li, Ken McMillan, and Mooly Sagiv. 2017. Synthesis of circular compositional program proofs via abduction. International Journal on Software Tools for Technology Transfer 19, 5 (2017), 535–547. Google Scholar
Digital Library
- E Allen Emerson and Roopsha Samanta. 2011. An Algorithmic Framework for Synthesis of Concurrent Programs.. In ATVA. Springer, 522– 530. Google Scholar
Digital Library
- Michael Emmi, Jeffrey S. Fischer, Ranjit Jhala, and Rupak Majumdar. 2007. Lock allocation. In POPL ’07: Proc. 34th symposium on Principles of Programming Languages . ACM Press, 291–296. Google Scholar
Digital Library
- Kostas Ferles, Jacob Van Geffen, Isil Dillig, and Yannis Smaragdakis. 2018. Symbolic Reasoning for Automatic Signal Placement (Extended Version). (2018). arXiv: 1804.02503Google Scholar
- Cormac Flanagan and K Rustan M Leino. 2001. Houdini, an annotation assistant for ESC/Java. In International Symposium of Formal Methods Europe . Springer, 500–517. Google Scholar
Digital Library
- Rui Gu, Guoliang Jin, Linhai Song, Linjie Zhu, and Shan Lu. 2015. What change history tells us about thread synchronization. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering . ACM, 426–438. Google Scholar
Digital Library
- Per Brinch Hansen. 1973. Operating system principles. Prentice-Hall, Inc. Google Scholar
Digital Library
- Tim Harris and Keir Fraser. 2003. Language support for lightweight transactions. In OOPSLA ’03: Proc. 18th conf. on Object-oriented Programing, Systems, Languages, and Applications . ACM Press, Anaheim, CA, 388–402. Google Scholar
Digital Library
- Maurice Herlihy and J. Eliot B. Moss. 1993. Transactional Memory: Architectural Support for Lock-Free Data Structures. In Proceedings of the 20th Annual International Symposium on Computer Architecture . 289–300. Google Scholar
Digital Library
- Michael Hicks, Jeffrey S. Foster, and Polyvios Prattikakis. 2006. Lock Inference for Atomic Sections. In Proceedings of the First ACM SIG-PLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing .Google Scholar
- C. A. R. Hoare. 1971. Towards a theory of parallel programming. In International Seminar on Operating System Techniques .Google Scholar
- Charles Antony Richard Hoare. 1974. Monitors: An operating system structuring concept. In The origin of concurrent programming. Springer, 272–294.Google Scholar
- David Hovemeyer and William Pugh. 2004. Finding concurrency bugs in Java. In Proc. of PODC, Vol. 4.Google Scholar
- Wei-Lun Hung and Vijay K. Garg. 2013. AutoSynch: An Automaticsignal Monitor Based on Predicate Tagging. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’13) . ACM, New York, NY, USA, 253–262. Google Scholar
Digital Library
- Guoliang Jin, Wei Zhang, Dongdong Deng, Ben Liblit, and Shan Lu. 2012. Automated Concurrency-Bug Fixing.. In OSDI, Vol. 12. 221–236. Google Scholar
Digital Library
- Pallavi Joshi, Mayur Naik, Chang-Seo Park, and Koushik Sen. 2009. CalFuzzer: An extensible active testing framework for concurrent programs. In Computer Aided Verification. Springer, 675–681. Google Scholar
Digital Library
- Pallavi Joshi, Mayur Naik, Koushik Sen, and David Gay. 2010. An effective dynamic analysis for detecting generalized deadlocks. In Proceedings of the eighteenth ACM SIGSOFT international symposium on Foundations of software engineering . ACM, 327–336. Google Scholar
Digital Library
- Vineet Kahlon. 2012. Automatic lock insertion in concurrent programs. In Formal Methods in Computer-Aided Design (FMCAD), 2012. IEEE, 16–23.Google Scholar
- Terence Kelly, Yin Wang, Stéphane Lafortune, and Scott Mahlke. 2009. Eliminating concurrency bugs with control engineering. Computer 42, 12 (2009). Google Scholar
Digital Library
- Sepideh Khoshnood, Markus Kusano, and Chao Wang. 2015. ConcBugAssist: constraint solving for diagnosis and repair of concurrency bugs. In Proceedings of the 2015 International Symposium on Software Testing and Analysis . ACM, 165–176. Google Scholar
Digital Library
- Shuvendu K Lahiri and Shaz Qadeer. 2009. Complexity and Algorithms for Monomial and Clausal Predicate Abstraction.. In CADE. Springer, 214–229. Google Scholar
Digital Library
- James R. Larus and Ravi Rajwar. 2007. Transactional Memory. Morgan & Claypool.Google Scholar
- Doug Lea. 1999. Concurrent Programming in Java. Second Edition: Design Principles and Patterns (2nd ed.). Addison-Wesley. Google Scholar
Digital Library
- Brandon Lucia and Luis Ceze. 2009. Finding concurrency bugs with context-aware communication graphs. In Proceedings of the 42nd Annual IEEE/ACM International Symposium on Microarchitecture . ACM, 553–563. Google Scholar
Digital Library
- Bill McCloskey, Feng Zhou, David Gay, and Eric Brewer. 2006. Autolocker: Synchronization inference for atomic sections. In POPL ’06: Proc. 33rd symposium on Principles of Programming Languages . ACM Press, 346–358. Google Scholar
Digital Library
- Madanlal Musuvathi, Shaz Qadeer, Thomas Ball, Gerard Basler, Piramanayagam Arumuga Nainar, and Iulian Neamtiu. 2008. Finding and Reproducing Heisenbugs in Concurrent Programs.. In OSDI, Vol. 8. 267–280. Google Scholar
Digital Library
- Mayur Naik, Alex Aiken, and John Whaley. 2006. Effective static race detection for Java . Vol. 41. ACM. Google Scholar
Digital Library
- Aleksey Shipilev, Sergey Kuksenko, Anders Astrand, Staffan Freiberg, and Henrik Loef. {n. d.}. OpenJDK: JMH. ({n. d.}). http://openjdk.java. net/projects/code-tools/jmh/Google Scholar
- Yannis Smaragdakis, Jacob Evans, Caitlin Sadowski, Jaeheon Yi, and Cormac Flanagan. 2012. Sound Predictive Race Detection in Polynomial Time. In ACM Symposium on Principles of Programming Languages (POPL) . ACM Press, 387–400. Google Scholar
Digital Library
- 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, 13. Google Scholar
Digital Library
- Martin Vechev, Eran Yahav, and Greta Yorsh. 2010. Abstraction-guided Synthesis of Synchronization. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’10) . ACM, New York, NY, USA, 327–338. Google Scholar
Digital Library
- Yin Wang, Stéphane Lafortune, Terence Kelly, Manjunath Kudlur, and Scott Mahlke. 2009. The theory of deadlock avoidance via discrete control. In ACM SIGPLAN Notices, Vol. 44. ACM, 252–263. Google Scholar
Digital Library
- Weiwei Xiong, Soyeon Park, Jiaqi Zhang, Yuanyuan Zhou, and Zhiqiang Ma. 2010. Ad Hoc Synchronization Considered Harmful.. In OSDI, Vol. 10. 163–176. Google Scholar
Digital Library
- Haiyan Zhu, Thomas Dillig, and Isil Dillig. 2013. Automated inference of library specifications for source-sink property verification. In Asian Symposium on Programming Languages and Systems . Springer, 290– 306. Google Scholar
Digital Library
Index Terms
Symbolic reasoning for automatic signal placement
Recommendations
Symbolic Reasoning for Automatic Signal Placement
Explicit signaling between threads is a perennial cause of bugs in concurrent programs. While there are several runtime techniques to automatically notify threads upon the availability of some shared resource, such techniques are not widely-adopted due ...
Symbolic reasoning for automatic signal placement
PLDI 2018: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and ImplementationExplicit signaling between threads is a perennial cause of bugs in concurrent programs. While there are several run-time techniques to automatically notify threads upon the availability of some shared resource, such techniques are not widely-adopted due ...
Synthesizing fine-grained synchronization protocols for implicit monitors
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 ...







Comments