skip to main content
research-article
Public Access

Symbolic reasoning for automatic signal placement

Published:11 June 2018Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

p120-ferles.webm

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Aws Albarghouthi, Isil Dillig, and Arie Gurfinkel. 2016. Maximal specification synthesis. In ACM SIGPLAN Notices, Vol. 51. ACM, 789– 801. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Gregory R. Andrews. 1991. Concurrent Programming: Principles and Practice . Benjamin-Cummings Publishing Co., Inc., Redwood City, CA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. Peter A Buhr, Michel Fortier, and Michael H Coffin. 1995. Monitor classification. ACM Computing Surveys (CSUR) 27, 1 (1995), 63–107. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. Dongdong Deng, Wei Zhang, and Shan Lu. 2013. Efficient concurrencybug detection across inputs. In Acm Sigplan Notices, Vol. 48. ACM, 785–802. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Edsger W Dijkstra. 1971. Hierarchical ordering of sequential processes. In The origin of concurrent programming. Springer, 198–227.Google ScholarGoogle Scholar
  15. Edsger W. Dijkstra. 2002. Cooperating Sequential Processes . Springer New York, New York, NY, 65–138. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Isil Dillig and Thomas Dillig. 2013. Explain: a tool for performing abductive inference. In International Conference on Computer Aided Verification . Springer, 684–689.Google ScholarGoogle ScholarCross RefCross Ref
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. E Allen Emerson and Roopsha Samanta. 2011. An Algorithmic Framework for Synthesis of Concurrent Programs.. In ATVA. Springer, 522– 530. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. Kostas Ferles, Jacob Van Geffen, Isil Dillig, and Yannis Smaragdakis. 2018. Symbolic Reasoning for Automatic Signal Placement (Extended Version). (2018). arXiv: 1804.02503Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. Per Brinch Hansen. 1973. Operating system principles. Prentice-Hall, Inc. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle Scholar
  28. C. A. R. Hoare. 1971. Towards a theory of parallel programming. In International Seminar on Operating System Techniques .Google ScholarGoogle Scholar
  29. Charles Antony Richard Hoare. 1974. Monitors: An operating system structuring concept. In The origin of concurrent programming. Springer, 272–294.Google ScholarGoogle Scholar
  30. David Hovemeyer and William Pugh. 2004. Finding concurrency bugs in Java. In Proc. of PODC, Vol. 4.Google ScholarGoogle Scholar
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. Guoliang Jin, Wei Zhang, Dongdong Deng, Ben Liblit, and Shan Lu. 2012. Automated Concurrency-Bug Fixing.. In OSDI, Vol. 12. 221–236. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  35. Vineet Kahlon. 2012. Automatic lock insertion in concurrent programs. In Formal Methods in Computer-Aided Design (FMCAD), 2012. IEEE, 16–23.Google ScholarGoogle Scholar
  36. Terence Kelly, Yin Wang, Stéphane Lafortune, and Scott Mahlke. 2009. Eliminating concurrency bugs with control engineering. Computer 42, 12 (2009). Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. Shuvendu K Lahiri and Shaz Qadeer. 2009. Complexity and Algorithms for Monomial and Clausal Predicate Abstraction.. In CADE. Springer, 214–229. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. James R. Larus and Ravi Rajwar. 2007. Transactional Memory. Morgan & Claypool.Google ScholarGoogle Scholar
  40. Doug Lea. 1999. Concurrent Programming in Java. Second Edition: Design Principles and Patterns (2nd ed.). Addison-Wesley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  43. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  44. Mayur Naik, Alex Aiken, and John Whaley. 2006. Effective static race detection for Java . Vol. 41. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. 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 ScholarGoogle Scholar
  46. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  47. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  48. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  49. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  50. Weiwei Xiong, Soyeon Park, Jiaqi Zhang, Yuanyuan Zhou, and Zhiqiang Ma. 2010. Ad Hoc Synchronization Considered Harmful.. In OSDI, Vol. 10. 163–176. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Symbolic reasoning for automatic signal placement

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!