skip to main content
article

Enforcing isolation and ordering in STM

Published:10 June 2007Publication History
Skip Abstract Section

Abstract

Transactional memory provides a new concurrency control mechanism that avoids many of the pitfalls of lock-based synchronization. High-performance software transactional memory (STM) implementations thus far provide weak atomicity: Accessing shared data both inside and outside a transaction can result in unexpected, implementation-dependent behavior. To guarantee isolation and consistent ordering in such a system, programmers are expected to enclose all shared-memory accesses inside transactions.

A system that provides strong atomicity guarantees isolation even in the presence of threads that access shared data outside transactions. A strongly-atomic system also orders transactions with conflicting non-transactional memory operations in a consistent manner.

In this paper, we discuss some surprising pitfalls of weak atomicity, and we present an STM system that avoids these problems via strong atomicity. We demonstrate how to implement non-transactional data accesses via efficient read and write barriers, and we present compiler optimizations that further reduce the overheads of these barriers. We introduce a dynamic escape analysis that differentiates private and public data at runtime to make barriers cheaper and a static not-accessed-in-transaction analysis that removes many barriers completely. Our results on a set of Java programs show that strong atomicity can be implemented efficiently in a high-performance STM system.

References

  1. A.-R. Adl-Tabatabai, B. T. Lewis, V. S. Menon, B. R. Murphy, B. Saha, and T. Shpeisman. Compiler and runtime support for efficient software transactional memory. In PLDI 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Adve and K. Gharachorloo. Shared memory consistency models: A tutorial. IEEE Computer, 29(12):66--76, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. Aldrich, E. G. Sirer, C. Chambers, and S. Eggers. Comprehensive synchronization elimination for Java. Sci. Comput. Programming, 47(2--3), May-June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. E. Allen, D. Chase, J. Hallett, V. Luchangco, J.-W. Maessen, S. Ryu, G. L. Steele, Jr., and STobin-Hochstadt. The Fortress language specification version 1.0&$945; http://research.sun.com/projects/plrg/fortress.pdf, 2006.Google ScholarGoogle Scholar
  5. C. S. Ananian, K. Asanovic, B. C. Kuszmaul, C. E. Leiserson, and S. Lie. Unbounded transactional memory. In HPCA 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. S. Ananian and M. Rinard. Efficient object-based software transactions. In SCOOL 2005.Google ScholarGoogle Scholar
  7. M. Berndl, O. Lhoták, F. Qian, L. Hendren, and N. Umanee. Points-to analysis using BDDs. In PLDI 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Blanchet. Escape analysis for object--oriented languages: Application to Java. In OOPSLA 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Blundell, E. C. Lewis, and M. Martin. Subtleties of transactional memory atomicity semantics. Computer Architecture Letters, 5(2), Nov. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. H. Boehm. Threads cannot be implemented as a library. In PLDI 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Bogda and U. Hölzle. Removing unnecessary synchronization in Java. In OOPSLA 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In OOPSLA 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. B. D. Carlstrom, J. Chung, A. McDonald, H. Chafi, C. Kozyrakis, and K. Olukotun. The Atomos transactional programming language. In PLDI 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. Charles, C. Donawa, K. Ebcioglu, C. Grothoff, A. Kielstra, C. von Praun, V. Saraswat, and V. Sarkar. X10: an object--oriented approach to non-uniform cluster computing. In OOPSLA 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J.-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Escape analysis for Java. In OOPSLA 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Cray Inc. Chapel Specification 0.4. http://linebreak{0}chapel.cs.linebreak{0}washington.edu/specification.pdf, 2005.Google ScholarGoogle Scholar
  17. P. Damron, A. Fedorova, Y. Lev, V. Luchangco, M. Moir, and D. Nussbaum. Hybrid transactional memory. In ASPLOS 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Dice, O. Shalev, and N. Shavit. Transactional Locking II. In DISC 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. T. Domani, G. Goldshtein, E. K. Kolodner, E. Lewis, E. Petrank, and D. Sheinwald. Thread-local heaps for Java. In ISMM 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Flanagan and S. N. Freund. Type inference against races. In SAS 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. K. Fraser. Practical lock freedom. PhD thesis, Cambridge University Computer Laboratory, 2003. Technical Report UCAM-CL-TR-579.Google ScholarGoogle Scholar
  22. J. Gray and A. Reuter. Transaction Processing: Concepts and Techniques. Morgan Kaufmann, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Grossman, J. Manson, and W. Pugh. What do high-level memory models mean for transactions? In ACM SIGPLAN Workshop on Memory Systems Performance & Correctness 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. L. Hammond, B. D. Carlstrom, V. Wong, B. Hertzberg, M. Chen, C. Kozyrakis, and K. Olukotun. Programming with transactional coherence and consistency (tcc). In ASPLOS 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. Harris and K. Fraser. Language support for lightweight transactions. In OOPSLA 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. Harris, S. Marlow, S. P. Jones, and M. Herlihy. Composable memory transactions. In PPoPP 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. T. Harris, M. Plesko, A. Shinnar, and D. Tarditi. Optimizing memory transactions. In PLDI 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Herlihy, V. Luch-angco, M. Moir, and I. William N. Scherer. Software transactional memory for dynamic-sized data structures. In PODC 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. M. Herlihy, V. Luchangco, and M. Moir. A flexible framework for implementing software transactional memory. In OOPSLA 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Herlihy and J. E. B. Moss. Transactional memory: architectural support for lock-free data structures. In ISCA 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. B. Hindman and D. Grossman. Atomicity via source-to-source translation. In ACM SIGPLAN Workshop on Memory Systems Performance & Correctness 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. R. L. Hudson, B. Saha, A.-R. Adl-Tabatabai, and B. C. Hertzberg. Mcrt-malloc: A scalable transactional memory allocator. In ISMM 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. Kumar, M. Chu, C. J. Hughes, P. Kundu, and A. Nguyen. Hybrid transactional memory. In PPoPP 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. H. T. Kung and J. T. Robinson. On optimistic methods for concurrency control. ACM Trans. Database Syst., 6(2), 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. J. Larus and R. Rajwar. Transactional Memory. Morgan & Claypool Publishers, 2006.Google ScholarGoogle ScholarCross RefCross Ref
  36. Y. Lev and J.-W. Maessen. Towards a safer interaction with transactional memory by tracking object visibility. In SCOOL 2005.Google ScholarGoogle Scholar
  37. J. Manson, J. Baker, A. Cunei, S. Jagannathan, M. Prochazka, B. Xin, and J. Vitek. Preemptible atomic regions for real-time Java. In IEEE Real-Time Systems Symposium 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. J. Manson, W. Pugh, and S. V. Adve. The Java memory model. In POPL 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. V. J. Marathe, W. N. Scherer, and M. L. Scott. Adaptive software transactional memory. In International Symposium on Distributed Computing 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. B. McCloskey, F. Zhou, D. Gay, and E. Brewer. Autolocker: synchronization inference for atomic sections. In POPL 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. A. McDonald, J. Chung, B. D. Carlstrom, C. Cao Minh, H. Chafi, C. Kozyrakis, and K. Olukotun. Architectural semantics for practical transactional memory. In ISCA 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. K. E. Moore, J. Bobba, M. J. Moravan, M. D. Hill, and D. A. Wood. LogTM: Log-based transactional memory. In HPCA 2006.Google ScholarGoogle ScholarCross RefCross Ref
  43. M. J. Moravan, J. Bobba, K. E. Moore, L. Yen, M. D. Hill, BLiblit, M. M. Swift, and D. A. Wood. Supporting nested transactional memory in LogTM. In ASPLOS 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In PLDI 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Y. Ni, V. Menon, A.-R. Adl-Tabatabai, A. L. Hosking, R. L. Hudson, J. E. B. Moss, B. Saha, and T. Shpeisman. Open Nesting in Software Transactional Memory. In PPoPP 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. R. Rajwar, M. Herlihy, and K. Lai. Virtualizing transactional memory. In ISCA 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. M. F. Ringenburg and D. Grossman. AtomCaml: first-class atomicity via rollback. In ICFP 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. E. Ruf. Effective synchronization removal for Java. In PLDI 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. B. Saha, A.-R. Adl-Tabatabai, R. Hudson, C. C. Minh, and B. Hertzberg. McRT-STM: A high performance software transactional memory system for a multi-core runtime. In PPoPP 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. B. Saha, A.-R. Adl-Tabatabai, and Q. Jacobson. Architectural support for software transactional memory. In MICRO 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. N. Shavit and D. Touitou. Software transactional memory. In PODC 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. M. F. Spear, V. J. Marathe, L. Dalessandro, and M. L. Scott. Privatization techniques for software transactional memory. Technical Report 915, University of Rochester, Computer Science Dept., 2007.Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. M. F. Spear, V. J. Marathe, W. N. Scherer, and M. L. Scott. Conflict detection and validation strategies for software transactional memory. In DISC 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Standard Performance Evaluation Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98.Google ScholarGoogle Scholar
  55. Standard Performance Evaluation Corporation. SPEC JBB2000, 2000. See http://www.spec.org/jbb2000.Google ScholarGoogle Scholar
  56. RVallée-Rai, L. Hendren, V. Sundaresan, P. Lam, E. Gagnon, and P. Co. Soot - a Java optimization framework. In CASCON 1999.Google ScholarGoogle Scholar
  57. C. von Praun and T. R. Gross. Static conflict analysis for multi-threaded object-oriented programs. In PLDI 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. C. Wang, W.-Y. Chen, Y. Wu, B. Saha, and A.-R. Adl-Tabatabai. Code Generation and Optimization for Transactional Memory Constructs in an Unmanaged Language. In CGO 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. A. Welc, S. Jagannathan, and A. L. Hosking. Revocation techniques for Java concurrency. In Concurrency and Computation:Practice and Experience. John Wiley and Sons, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Enforcing isolation and ordering in STM

            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!