skip to main content
research-article

Asynchronous programming, analysis and testing with state machines

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

Programming efficient asynchronous systems is challenging because it can often be hard to express the design declaratively, or to defend against data races and interleaving-dependent assertion violations. Previous work has only addressed these challenges in isolation, by either designing a new declarative language, a new data race detection tool or a new testing technique. We present P#, a language for high-reliability asynchronous programming co-designed with a static data race analysis and systematic concurrency testing infrastructure. We describe our experience using P# to write several distributed protocols and port an industrial-scale system internal to Microsoft, showing that the combined techniques, by leveraging the design of P#, are effective in finding bugs.

References

  1. T. Andrews, S. Qadeer, S. K. Rajamani, J. Rehof, and Y. Xie. Zing: A model checker for concurrent software. In Proceedings of the 16th International Conference on Computer Aided Verification, volume 3114 of Lecture Notes in Computer Science, pages 484–487. Springer, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  2. Apple Inc. Grand Central Dispatch (GCD) reference, accessed November 2014. URL https://developer.apple.com/library/mac/ documentation/Performance/Reference/GCD_libdispatch_ Ref/index.html.Google ScholarGoogle Scholar
  3. S. Blackshear, B. E. Chang, and M. Sridharan. Thresher: Precise refutations for heap reachability. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 275–286. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Burckhardt, P. Kothari, M. Musuvathi, and S. Nagarakatte. A randomized scheduler with probabilistic guarantees of finding bugs. In Proceedings of the 15th Edition of ASPLOS on Architectural Support for Programming Languages and Operating Systems, pages 167–178. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. T. D. Chandra, R. Griesemer, and J. Redstone. Paxos made live: An engineering perspective. In Proceedings of the 26th Annual ACM Symposium on Principles of Distributed Computing, pages 398–407. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Desai, V. Gupta, E. K. Jackson, S. Qadeer, S. K. Rajamani, and D. Zufferey. P: Safe asynchronous event-driven programming. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 321–332. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Desai, P. Garg, and P. Madhusudan. Natural proofs for asynchronous programs using almost-synchronous reductions. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, pages 709––725. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Desai, S. Qadeer, and S. Seshia. Systematic testing of asynchronous reactive systems. Technical Report MSR-TR-2015-25, Microsoft Research, 2015.Google ScholarGoogle Scholar
  9. M. Emmi, S. Qadeer, and Z. Rakamari´c. Delay-bounded scheduling. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 411–422. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. German. Tutorial on verification of distributed cache memory protocols. In Formal Methods in Computer Aided Design, 2004.Google ScholarGoogle Scholar
  11. P. Godefroid. Partial-Order Methods for the Verification of Concurrent Systems: An Approach to the State-Explosion Problem. Springer, 1996. Google ScholarGoogle ScholarCross RefCross Ref
  12. P. Godefroid. Model checking for programming languages using VeriSoft. In Proceedings of the 24th ACM Symposium on Principles of Programming Languages, pages 174–186. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. N. Gray. Notes on Data Base Operating Systems. Springer, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  14. O. Gruber and F. Boyer. Ownership-based isolation for concurrent actors on multi-core machines. In Proceedings of the 27th European Conference on Object-Oriented Programming, volume 7920 of Lecture Notes in Computer Science, pages 281–301. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. P. Haller and M. Odersky. Capabilities for uniqueness and borrowing. In Proceedings of the 24th European Conference on Object-Oriented Programming, volume 6183 of Lecture Notes in Computer Science, pages 354–378. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. L. Lamport. The part-time parliament. ACM Transactions on Computer Systems, 16(2):133–169, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Lauterburg, R. K. Karmani, D. Marinov, and G. Agha. Evaluating ordering heuristics for dynamic partial-order reduction techniques. In Proceedings of the 13th International Conference on Fundamental Approaches to Software Engineering, volume 6013 of Lecture Notes in Computer Science, pages 308–322. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Leijen, W. Schulte, and S. Burckhardt. The design of a task parallel library. In Proceedings of the 24th ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications, pages 227–242. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and reproducing Heisenbugs in concurrent programs. In Proceedings of the 8th USENIX Conference on Operating Systems Design and Implementation, pages 267–280. USENIX Association, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. Negara, R. K. Karmani, and G. Agha. Inferring ownership transfer for efficient message passing. In Proceedings of the 16th ACM Symposium on Principles and Practice of Parallel Programming, pages 81–90. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Odersky, L. Spoon, and B. Venners. Programming in Scala. Artima Inc, 2008.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. D. Ongaro and J. Ousterhout. In search of an understandable consensus algorithm. In Proceedings of the 2014 USENIX Annual Technical Conference, pages 305–319. USENIX Association, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. K. Sen and G. Agha. Automated systematic testing of open distributed programs. In Proceedings of the 9th International Conference on Fundamental Approaches to Software Engineering, volume 3922 of Lecture Notes in Computer Science, pages 339–356. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. I. Stoica, R. Morris, D. Karger, M. F. Kaashoek, and H. Balakrishnan. Chord: A scalable peer-to-peer lookup service for internet applications. In Proceedings of the 2001 Conference on Applications, Technologies, Architectures, and Protocols for Computer Communications, pages 149–160. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. Thomson, A. F. Donaldson, and A. Betts. Concurrency testing using schedule bounding: An empirical study. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pages 15–28. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. R. van Renesse and F. B. Schneider. Chain replication for supporting high throughput and availability. In Proceedings of the 6th Symposium on Operating Systems Design and Implementation, pages 91–104. USENIX Association, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. C. Varela and G. Agha. Programming dynamically reconfigurable open systems with SALSA. ACM SIGPLAN Notices, 36(12):20–34, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. R. Virding, C. Wikström, and M. Williams. Concurrent Programming in Erlang. Prentice Hall International, 2nd edition, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Asynchronous programming, analysis and testing with state machines

              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

              • Published in

                cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 50, Issue 6
                PLDI '15
                June 2015
                630 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/2813885
                • Editor:
                • Andy Gill
                Issue’s Table of Contents
                • cover image ACM Conferences
                  PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation
                  June 2015
                  630 pages
                  ISBN:9781450334686
                  DOI:10.1145/2737924

                Copyright © 2015 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 3 June 2015

                Check for updates

                Qualifiers

                • research-article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader