skip to main content
research-article
Free Access

Semantics of transactional memory and automatic mutual exclusion

Published:25 January 2011Publication History
Skip Abstract Section

Abstract

Software Transactional Memory (STM) is an attractive basis for the development of language features for concurrent programming. However, the semantics of these features can be delicate and problematic. In this article we explore the trade-offs semantic simplicity, the viability of efficient implementation strategies, and the flexibility of language constructs. Specifically, we develop semantics and type systems for the constructs of the Automatic Mutual Exclusion (AME) programming model; our results apply also to other constructs, such as atomic blocks. With this semantics as a point of reference, we study several implementation strategies. We model STM systems that use in-place update, optimistic concurrency, lazy conflict detection, and rollback. These strategies are correct only under nontrivial assumptions that we identify and analyze. One important source of errors is that some efficient implementations create dangerous “zombie” computations where a transaction keeps running after experiencing a conflict; the assumptions confine the effects of these computations.

References

  1. Abadi, M. 2008. Automatic mutual exclusion and atomicity checks. In Concurrency, Graphs and Models, Essays Dedicated to Ugo Montanari on the Occasion of His 65th Birthday, P. Degano, R. D. Nicola, and J. Meseguer, Eds. Lecture Notes in Computer Science, vol. 5065. Springer-Verlag, 510--526. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Abadi, M., Birrell, A., Harris, T., Hsieh, J., and Isard, M. 2008. Dynamic separation for transactional memory. Tech. rep. MSR-TR-2008-43, Microsoft Research.Google ScholarGoogle Scholar
  3. Abadi, M., Birrell, A., Harris, T., Hsieh, J., and Isard, M. 2009. Implementation and use of transactional memory with dynamic separation. In Proceedings of the 18th International Conference on Compiler Construction (CC'09), O. de Moor and M. I. Schwartzbach, Eds. Lecture Notes in Computer Science, vol. 5501. Springer-Verlag, 63--77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Abadi, M., Flanagan, C., and Freund, S. N. 2006. Types for safe locking: Static race detection for Java. ACM Trans. Program. Lang. Syst. 28, 2, 207--255. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Abadi, M., Harris, T., and Moore, K. F. 2008. A model of dynamic separation for transactional memory. In Proceedings of the 19th International Confernece on Concurrency Theory (CONCUR'08), F. van Breugel and M. Chechik, Eds. Lecture Notes in Computer Science, vol. 5201. Springer-Verlag, 6--20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Adl-Tabatabai, A.-R., Lewis, B. T., Menon, V., Murphy, B. R., Saha, B., and Shpeisman, T. 2006. Compiler and runtime support for efficient software transactional memory. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06). 26--37. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Adve, S. V. and Hill, M. D. 1990. Weak ordering--a new definition. SIGARCH Comput. Archit. News 18, 3a, 2--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Adya, A., Howell, J., Theimer, M., Bolosky, W. J., and Douceur, J. R. 2002. Cooperative task management without manual stack management. In Proceedings of the USENIX Annual Technical Conference (USENIX'02). 289--302. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Allen, E., Chase, D., Hallett, J., Luchangco, V., Maessen, J.-W., Ryu, S., Steele Jr., G. L., and Tobin-Hochstadt, S. 2007. The Fortress language specification, v1.0β. Tech. rep., Sun Microsystems.Google ScholarGoogle Scholar
  10. Blundell, C., Lewis, E. C., and Martin, M. M. K. 2006. Subtleties of transactional memory atomicity semantics. Comput. Archit. Lett. 5, 2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Bronson, N. G., Kozyrakis, C., and Olukotun, K. 2009. Feedback-directed barrier optimization in a strongly isolated STM. In Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'09). 213--225. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Carlstrom, B. D., McDonald, A., Chafi, H., Chung, J., Minh, C. C., Kozyrakis, C., and Olukotun, K. 2006. The Atomos transactional programming language. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06). 1--13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Cohen, A., O'Leary, J. W., Pnueli, A., Tuttle, M. R., and Zuck, L. D. 2007. Verifying correctness of transactional memories. In Proceedings of the 7th International Conference on Formal Methods in Computer-Aided Design (FMCAD'07). 37--44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Dalessandro, L. and Scott, M. L. 2009. Strong isolation is a weak idea. In Proceedings of the 4th Workshop on Transactional Computing (TRANSACT'09).Google ScholarGoogle Scholar
  15. Dice, D., Shalev, O., and Shavit, N. 2006. Transactional locking II. In Proceedings of the 20th International Symposium on Distributed Computing (DISC'06), S. Dolev, Ed., Lecture Notes in Computer Science, vol. 4167. Springer, 194--208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Dice, D. and Shavit, N. 2006. What really makes transactions faster? In Proceedings of the ACM SIGPLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing (TRANSACT'06). http://hdl.handle.net/1802/4051.Google ScholarGoogle Scholar
  17. Grossman, D., Manson, J., and Pugh, W. 2006. What do high-level memory models mean for transactions? In Proceedings of the Workshop on Memory System Performance and Correctness (MSPC'06). 62--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Guerraoui, R., Henzinger, T., and Singh, V. 2008a. Model checking transactional memories. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'08). 372--382. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Guerraoui, R., Henzinger, T. A., and Singh, V. 2008b. Completeness and nondeterminism in model checking transactional memories. In Proceedings of the 19th International Confernece on Concurrency Theory (CONCUR'08), F. van Breugel and M. Chechik, Eds. Lecture Notes in Computer Science, vol. 5201. Springer-Verlag, 21--35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Harris, T. and Fraser, K. 2003. Language support for lightweight transactions. In Proceedings of the 18th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'03). 388--402. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Harris, T., Marlow, S., Peyton Jones, S., and Herlihy, M. 2005. Composable memory transactions. In Proceedings of the 10th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'05). 48--60. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Harris, T., Plesko, M., Shinnar, A., and Tarditi, D. 2006. Optimizing memory transactions. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06). 14--25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Igarashi, A., Pierce, B. C., and Wadler, P. 2001. Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23, 3, 396--450. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Isard, M. and Birrell, A. 2007. Automatic mutual exclusion. In Proceedings of the 11th Workshop on Hot Topics in Operating Systems (HotOS'07). Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Jagannathan, S., Vitek, J., Welc, A., and Hosking, A. 2005. A transactional object calculus. Sci. Comput. Program. 57, 2, 164--186. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Kuszmaul, B. C. and Leiserson, C. E. 2003. Transactions everywhere. Tech. rep., MIT. http://hdl.handle.net/1721.1/3692.Google ScholarGoogle Scholar
  27. Liblit, B. 2006. An operational semantics for LogTM. Tech. rep. 1571, University of Wisconsin--Madison. Version 1.0.Google ScholarGoogle Scholar
  28. Manson, J., Baker, J., Cunei, A., Jagannathan, S., Prochazka, M., Xin, B., and Vitek, J. 2005. Preemptible atomic regions for real-time Java. In Proceedings of the 26th IEEE Real-Time Systems Symposium (RTSS'05). 62--71. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Manson, J., Pugh, W., and Adve, S. V. 2005. The Java memory model. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'05). 378--391. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Menon, V., Balensiefer, S., Shpeisman, T., Adl-Tabatabai, A.-R., Hudson, R., Saha, B., and Welc, A. 2008. Practical weak-atomicity semantics for Java STM. In Proceedings of the 20th Annual Symposium on Parallelism in Algorithms and Architectures (SPAA'08). 314--325. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Moore, K. E., Bobba, J., Moravan, M. J., Hill, M. D., and Wood, D. A. 2006. LogTM: Log-based transactional memory. In Proceedings of the 12th International Symposium on High-Performance Computer Architecture (HPCA'06). 254--265.Google ScholarGoogle Scholar
  32. Moore, K. F. and Grossman, D. 2008. High-level small-step operational semantics for transactions. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'08). 51--62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Naik, M., Aiken, A., and Whaley, J. 2006. Effective static race detection for Java. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06). 308--319. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Saha, B., Adl-Tabatabai, A.-R., Hudson, R. L., Minh, C. C., and Hertzberg, B. 2006. McRT-STM: a high performance software transactional memory system for a multi-core runtime. In Proceedings of the 11th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'06). 187--197. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Schneider, F. T., Menon, V., Shpeisman, T., and Adl-Tabatabai, A.-R. 2008. Dynamic optimization for efficient strong atomicity. In Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications (OOPSLA'08). 181--194. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Scott, M. L. 2006. Sequential specification of transactional memory semantics. In Proceedings of the 1st ACM SIGPLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing (TRANSACT'06). http://hdl.handle.net/1802/4050.Google ScholarGoogle Scholar
  37. Shavit, N. and Touitou, D. 1995. Software transactional memory. In Proceedings of the 14th ACM Symposium on Principles of Distributed Computing (PODC'95). 204--213. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Shpeisman, T., Menon, V., Adl-Tabatabai, A.-R., Balensiefer, S., Grossman, D., Hudson, R. L., Moore, K. F., and Saha, B. 2007. Enforcing isolation and ordering in STM. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'07). 78--88. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Spear, M. F., Dalessandro, L., Marathe, V., and Scott, M. L. 2008. Ordering-based semantics for software transactional memory. In Proceedings of the 12th International Conference on Principles of Distributed Systems (OPODIS'08), T. P. Baker, A. Bui, and S. Tixeuil, Eds. Lecture Notes in Computer Science, vol. 972. Springer, 275--294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Spear, M. F., Marathe, V. J., Dalessandro, L., and Scott, M. L. 2007. Privatization techniques for software transactional memory. Tech. rep. 915, University of Rochester.Google ScholarGoogle Scholar
  41. Sterling, N. 1993. Warlock: A static data race analysis tool. In Proceedings of the USENIX Winter Technical Conference. 97--106.Google ScholarGoogle Scholar
  42. Tasiran, S. 2008. A compositional method for verifying software transactional memory implementations. Tech. rep. MSR-TR-2008-56, Microsoft Research.Google ScholarGoogle Scholar
  43. Wang, C., Chen, W.-Y., Wu, Y., Saha, B., and Adl-Tabatabai, A.-R. 2007. Code generation and optimization for transactional memory constructs in an unmanaged language. In Proceedings of the International Symposium on Code Generation and Optimization (CGO'07). 34--48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Welc, A., Jagannathan, S., and Hosking, A. 2005. Safe futures for Java. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'05). 439--453. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Wright, A. K. and Felleisen, M. 1994. A syntactic approach to type soundness. Inform. Computat. 115, 1, 38--94. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Semantics of transactional memory and automatic mutual exclusion

      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 Transactions on Programming Languages and Systems
        ACM Transactions on Programming Languages and Systems  Volume 33, Issue 1
        January 2011
        218 pages
        ISSN:0164-0925
        EISSN:1558-4593
        DOI:10.1145/1889997
        Issue’s Table of Contents

        Copyright © 2011 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 25 January 2011
        • Accepted: 1 January 2010
        • Revised: 1 August 2009
        • Received: 1 November 2008
        Published in toplas Volume 33, Issue 1

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      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!