skip to main content
research-article

Cooperative reasoning for preemptive execution

Authors Info & Claims
Published:12 February 2011Publication History
Skip Abstract Section

Abstract

We propose a cooperative methodology for multithreaded software, where threads use traditional synchronization idioms such as locks, but additionally document each point of potential thread interference with a "yield" annotation. Under this methodology, code between two successive yield annotations forms a serializable transaction that is amenable to sequential reasoning. This methodology reduces the burden of reasoning about thread interleavings by indicating only those interference points that matter. We present experimental results showing that very few yield annotations are required, typically one or two per thousand lines of code. We also present dynamic analysis algorithms for detecting cooperability violations, where thread interference is not documented by a yield, and for yield annotation inference for legacy software.

References

  1. M. Abadi and G. Plotkin. A model of cooperative threads. In Symposium on Principles of Programming Languages (POPL), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. V. Adve and K. Gharachorloo. Shared memory consistency models: A tutorial. IEEE Computer, 29(12):66--76, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Adya, J. Howell, M. Theimer, W. J. Bolosky, and J. R. Douceur. Cooperative task management without manual stack management. In Annual Technical Conference. USENIX Association, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. M. Amadio and S. D. Zilio. Resource control for synchronous cooperative threads. In International Conference on Concurrency Theory (CONCUR), 2004.Google ScholarGoogle ScholarCross RefCross Ref
  5. C. Artho, K. Havelund, and A. Biere. High-level data races. In International Conference on Verification and Validation of Enterprise Information Systems (ICEIS), 2003.Google ScholarGoogle ScholarCross RefCross Ref
  6. E. D. Berger, T. Yang, T. Liu, and G. Novark. Grace: Safe multithreaded programming for C/C. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. L. Bocchino, Jr., V. S. Adve, D. Dig, S. Adve, S. Heumann, R. Komuravelli, J. Overbey, P. Simmons, H. Sung, and M. Vakilian. A type and effect system for Deterministic Parallel Java. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. D. Bond, K. E. Coons, and K. S. McKinley. PACER: Proportional detection of data races. In Conference on Programming Language Design and Implementation (PLDI), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Boudol. Fair cooperative multithreading. In International Conference on Concurrency Theory (CONCUR), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Burnim and K. Sen. Asserting and checking determinism for multithreaded programs. In International Symposium on Foundations of Software Engineering (FSE), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Farzan and P. Madhusudan. Causal atomicity. In Computer Aided Verification (CAV), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Farzan and P. Madhusudan. Monitoring atomicity in concurrent programs. In Computer Aided Verification (CAV), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Flanagan and S. N. Freund. FastTrack: Efficient and precise dynamic race detection. In Conference on Programming Language Design and Implementation (PLDI), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Flanagan and S. N. Freund. The RoadRunner dynamic analysis framework for concurrent programs. In Program Analysis for Software Tools and Engineering (PASTE), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Flanagan, S. N. Freund, M. Lifshin, and S. Qadeer. Types for atomicity: Static checking and inference for Java. Transactions on Programming Languages and Systems (TOPLAS), 30(4):1--53, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Flanagan, S. N. Freund, and J. Yi. Velodrome: A sound and complete dynamic atomicity checker for multithreaded programs. In Conference on Programming Language Design and Implementation (PLDI), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. E. Fleury and G. Sutre. Raja, version 0.4.0-pre4. Available at \texttthttp://raja.sourceforge.net/, 2007.Google ScholarGoogle Scholar
  18. M. Isard and A. Birrell. Automatic mutual exclusion. In Workshop on Hot Topics in Operating Systems (HOTOS), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. N. Jalbert and K. Sen. A trace simplification technique for effective debugging of concurrent programs. In International Symposium on Foundations of Software Engineering (FSE), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Java Grande Forum. Java Grande benchmark suite. Available at http://www.javagrande.org, 2008.Google ScholarGoogle Scholar
  21. A. Kulkarni, Y. D. Liu, and S. F. Smith. Task types for pervasive atomicity. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. L. Lamport. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 21(7):558--565, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. R. Larus and R. Rajwar. Transactional Memory. Synthesis Lectures on Computer Architecture. Morgan & Claypool Publishers, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. N. D. Matsakis and T. R. Gross. A time-aware type system for data-rrace protection and guaranteed initialization. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Olszewski, J. Ansel, and S. Amarasinghe. Kendo: efficient deterministic multithreading in software. In International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. C.-S. Park and K. Sen. Randomized active atomicity violation detection in concurrent programs. In International Symposium on Foundations of Software Engineering (FSE), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. P. Ratanaworabhan, M. Burtscher, D. Kirovski, B. Zorn, R. Nagpal, and K. Pattabiraman. Detecting and tolerating asymmetric races. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. C. Sadowski, S. N. Freund, and C. Flanagan. SingleTrack: A dynamic determinism checker for multithreaded programs. In European Symposium on Programming (ESOP), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. C. Sadowski and J. Yi. Applying usability studies to correctness conditions: A case study of cooperability. In Onward! Workshop on Evaluation and Usability of Programming Languages and Tools (PLATEAU), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Sasturkar, R. Agarwal, L. Wang, and S. D. Stoller. Automated type-based analysis of data races and atomicity. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Y. Smaragdakis, A. Kay, R. Behrends, and M. Young. Transactions with isolation and cooperation. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Standard Performance Evaluation Corporation. SPEC benchmarks. http://www.spec.org/, 2003.Google ScholarGoogle Scholar
  33. The World Wide Web Consortium. Jigsaw Web Server. Available from http://www.w3.org/Jigsaw/, 2009.Google ScholarGoogle Scholar
  34. T. Usui, Y. Smaragdakis, R. Behrends, and J. Evans. Adaptive locks: Combining transactions and locks for efficient concurrency. In Parallel Architectures and Compilation Techniques (PACT), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. R. Von Behren, J. Condit, F. Zhou, G. Necula, and E. Brewer. Capriccio: scalable threads for internet services. ACM SIGOPS Operating Systems Review, 37(5):281, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. C. von Praun and T. Gross. Static conflict analysis for multi-threaded object-oriented programs. In Conference on Programming Language Design and Implementation (PLDI), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. L. Wang and S. D. Stoller. Accurate and efficient runtime detection of atomicity errors in concurrent programs. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. J. Yi and C. Flanagan. Effects for cooperable and serializable threads. In Workshop on Types in Language Design and Implementation (TLDI), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Cooperative reasoning for preemptive execution

      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 46, Issue 8
        PPoPP '11
        August 2011
        300 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2038037
        Issue’s Table of Contents
        • cover image ACM Conferences
          PPoPP '11: Proceedings of the 16th ACM symposium on Principles and practice of parallel programming
          February 2011
          326 pages
          ISBN:9781450301190
          DOI:10.1145/1941553
          • General Chair:
          • Calin Cascaval,
          • Program Chair:
          • Pen-Chung Yew

        Copyright © 2011 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 12 February 2011

        Check for updates

        Qualifiers

        • research-article

      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!