skip to main content
article

Optimizing memory transactions

Published:11 June 2006Publication History
Skip Abstract Section

Abstract

Atomic blocks allow programmers to delimit sections of code as 'atomic', leaving the language's implementation to enforce atomicity. Existing work has shown how to implement atomic blocks over word-based transactional memory that provides scalable multi-processor performance without requiring changes to the basic structure of objects in the heap. However, these implementations perform poorly because they interpose on all accesses to shared memory in the atomic block, redirecting updates to a thread-private log which must be searched by reads in the block and later reconciled with the heap when leaving the block.This paper takes a four-pronged approach to improving performance: (1) we introduce a new 'direct access' implementation that avoids searching thread-private logs, (2) we develop compiler optimizations to reduce the amount of logging (e.g. when a thread accesses the same data repeatedly in an atomic block), (3) we use runtime filtering to detect duplicate log entries that are missed statically, and (4) we present a series of GC-time techniques to compact the logs generated by long-running atomic blocks.Our implementation supports short-running scalable concurrent benchmarks with less than 50\% overhead over a non-thread-safe baseline. We support long atomic blocks containing millions of shared memory accesses with a 2.5-4.5x slowdown.

References

  1. Agesen, O., Detlefs, D., Garthwaite, A., Knippel, R., Ramakrishna, Y. S., and White, D. An efficient meta-lock for implementing ubiquitous synchronization. In Object-Oriented Programming, Systems, Languages & Applications (OOPSLA) (Nov. 1999), vol. 34(10) of ACM SIGPLAN Notices, pp. 207--222. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Allan, E., Chase, D., Luchangco, V., Maessen, J.-W., Ryu, S., Steele Jr, G. L., and Tobin-Hochstadt, S. The Fortress language specification v0.618, Apr. 2005.Google ScholarGoogle Scholar
  3. Ananian, C. S., and Rinard, M. Efficient software transactions for object-oriented languages. In OOPSLA 2005 Workshop on Synchronization and Concurrency in Object-Oriented Lanaguages (SCOOL) (Oct. 2005). Also available in the University of Rochester digital archive.Google ScholarGoogle Scholar
  4. Bacon, D. F., Konuru, R., Murthy, C., and Serrano, M. Thin locks: Featherweight synchronization for Java. In Programming Language Design and Implementation (PLDI) (Jun. 1998), vol. 33(5) of ACM SIGPLAN Notices, pp. 258--268. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Carlstrom, B. D., Chung, J., Chafi, H., McDonald, A., Minh, C. C., Hammond, L., Kozyrakis, C., and Olukotun, K. Transactional execution of Java programs. In OOPSLA 2005 Workshop on Synchronization and Concurrency in Object-Oriented Lanaguages (SCOOL) (Oct. 2005). Also available in the University of Rochester digital archiveGoogle ScholarGoogle Scholar
  6. Charles, P., Donawa, C., Ebcioglu, K., Grothoff, C., Kielstra, A., Sarkar, V., and Praun, C. V. X10: An object-oriented approach to non-uniform cluster computing. In Object-Oriented Programming, Systems, Languages & Applications (OOPSLA) (Oct. 2005), pp. 519--538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Cray Inc. The Chapel language specification v0.4, Feb. 2005.Google ScholarGoogle Scholar
  8. Dice, D. Implementing fast Java monitors with relaxed-locks. In Proceedings of USENIX JVM 2001 (2001), pp. 79--90. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Diniz, P. C., and Rinard, M. C. Lock coarsening: Eliminating lock overhead in automatically parallelized object-based programs. Journal of Parallel and Distributed Computing 49, 2 (Mar. 1998), 218--244. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Fraser, K. Practical lock freedom. PhD thesis, University of Cambridge Computer Laboratory, 2003.Google ScholarGoogle Scholar
  11. Harris, T. Exceptions and side-effects in atomic blocks. In PODC 2004 Workshop on Concurrency and Synchronization in Java programs (CSJP) (Jul. 2004), pp. 46--53. Proceedings published as Memorial University of Newfoundland CS Technical Report 2004-01. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Harris, T., and Fraser, K. Language support for lightweight transactions. In Object-Oriented Programming, Systems, Langauges & Applications (OOPSLA) (Oct. 2003), pp. 388--402. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Harris, T., Herlihy, M., Marlow, S., and Peyton-Jones, S. Composable memory transactions. In Symposium on Principles and Practice of Parallel Programming (PPoPP) (Jun. 2005), pp. 48--60. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Hanke, S., Ottmann, T., and Soisalon-Soininen, E. Relaxed Balanced Red-Black Trees. In Italian Conference on Algorithms and Complexity (1997), vol. 1203 of Springer-Verlag LNCS, pp. 193--204. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Herlihy, M. SXM1.1: Software transactional memory package for c#. Tech. rep., Brown University & Microsoft Research, May 2005.Google ScholarGoogle Scholar
  16. Herlihy, M., Luchangco, V., Moir, M., and Scherer, III, W. N. Software transactional memory for dynamic-sized data structures. In Principles of Distributed Computing (PODC) (Jul. 2003), pp. 92--101. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Herlihy, M., and Moss, J. E. B. Transactional memory: architectural support for lock-free data structures. In International Symposium on Computer Architecture (ISCA) (May 1993), pp. 289--300. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Herlihy, M. P., and Wing, J. M. Linearizability: A correctness condition for concurrent objects. ACM Transactions on Programming Languages and Systems (TOPLAS) 12, 3 (Jul. 1990), 463--492. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Hunt, G.C. et al. An overview of the Singularity project. Tech. Rep. MSR-TR-2005-135, Microsoft Research, Oct. 2005.Google ScholarGoogle Scholar
  20. International Business Machines Corp. System/370 Principles of Operation, 1983.Google ScholarGoogle Scholar
  21. Kaunitz, J., and van Ekert, L. Audit trail compaction for database recovery. Commun. ACM 27, 7 (Jul. 1984), 678--683. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Liskov, B. Distributed programming in argus. Commun. ACM 31, 3 (Mar. 1988), 300--312. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Marathe, V. J., Scherer III, W. N., and Scott, M. L. Design tradeoffs in modern software transactional memory systems. In Proceedings of the 7th Workshop on Languages, Compilers, and Run-time Support for Scalable Systems (Oct. 2004). Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Rajwar, R., and Goodman, J. R. Speculative lock elision: Enabling highly concurrent multithreaded execution. In 34th Annual International Symposium on Microarchitecture (Dec. 2001), pp. 294--305. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Rajwar, R., and Goodman, J. R. Transactional lock-free execution of lock-based programs. In Architectural Support for Programming Languages and Operating Systems (ASPLOS), vol. 37(10) of ACM SIG\-PLAN Notices, pp. 5--17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Rajwar, R., Herlihy, M., and Lai, K. Virtualizing transactional memory. In International Symposium on Computer Architecture (ISCA) (Jun. 2005), pp.494--505. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Ringenburg, M. F., and Grossman, D. AtomCaml: First-class atomicity via rollback. In International Conference on Functional Programming (ICFP) (Sept. 2005), pp. 92--104. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Scherer III, W. N., and Scott, M. L. Contention management in dynamic software transactional memory. In PODC 2004 Workshop on Concurrency and Synchronization in Java Programs (CSJP) (Jul. 2004). Proceedings published as Memorial University of Newfoundland CS Technical Report 2004-01 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Shinnar, A., Tarditi, D., Plesko, M., and Steensgaard, B. Integrating support for undo with exception handling. Tech. Rep. MSR-TR-2004-140, Microsoft Research, Dec. 2004.Google ScholarGoogle Scholar
  30. Welc, A., Jagannathan, S., and Hosking, A. Transactional monitors for concurrent objects. In European Conference on Object-Oriented Programming (ECOOP) (Jun. 2004), pp.519--542.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Optimizing memory transactions

    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 41, Issue 6
      Proceedings of the 2006 PLDI Conference
      June 2006
      426 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1133255
      Issue’s Table of Contents
      • cover image ACM Conferences
        PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation
        June 2006
        438 pages
        ISBN:1595933204
        DOI:10.1145/1133981

      Copyright © 2006 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 11 June 2006

      Check for updates

      Qualifiers

      • 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!