skip to main content
10.1145/1806596.1806627acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Lock elision for read-only critical sections in Java

Published:05 June 2010Publication History

ABSTRACT

It is not uncommon in parallel workloads to encounter shared data structures with read-mostly access patterns, where operations that update data are infrequent and most operations are read-only. Typically, data consistency is guaranteed using mutual exclusion or read-write locks. The cost of atomic update of lock variables result in high overheads and high cache coherence traffic under active sharing, thus slowing down single thread performance and limiting scalability.

In this paper, we present SOLERO (Software Optimistic Lock Elision for Read-Only critical sections), a new lock implementation called for optimizing read-only critical sections in Java based on sequential locks. SOLERO is compatible with the conventional lock implementation of Java. However, unlike the conventional implementation, only critical sections that may write data or have side effects need to update lock variables, while read-only critical sections need only read lock variables without writing them. Each writing critical section changes the lock value to a new value. Hence, a read-only critical section is guaranteed to be consistent if the lock is free and its value does not change from the beginning to the end of the read-only critical section.

Using Java workloads including SPECjbb2005 and the HashMap and TreeMap Java classes, we evaluate the performance impact of applying SOLERO to read-mostly locks. Our experimental results show performance improvements across the board, often substantial, in both single thread speed and scalability over the conventional lock implementation (mutual exclusion) and read-write locks. SOLERO improves the performance of SPECjbb2005 by 3-5% on single and multiple threads. The results using the HashMap and TreeMap benchmarks show that SOLERO outperforms the conventional lock implementation and read-write locks by substantial multiples on multi-threads.

References

  1. D. F. Bacon, R. Konuru, C. Murthy, and M. Serrano. Thin locks: Featherweight synchronization for java. In PLDI'98: Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation, pages 258--268, June 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In OOPSLA'06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-Oriented Programing, Systems, Languages, and Applications, pages 169--190, Oct. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. P.-J. Courtois, F. Heymans, and D. L. Parnas. Concurrent control with "readers" and "writers". Commun. ACM, 14(10):667--668, Oct. 1971. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Dice. Seqlocks in java -- readers shouldn't write synchronization metadata. David Dice's Weblog, Sept. 2006.Google ScholarGoogle Scholar
  5. D. Dice, Y. Lev, M. Moir, and D. Nussbaum. Early experience with a commercial hardware transactional memory implementation. In ASPLOS'09: Proceedings of the 14th international conference on Architectural support for programming languages and operating systems, pages 157--168, Mar. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. W. Dijkstra. Solution of a problem in concurrent programming control. Commun. ACM, 8(9):569, Sept. 1965. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Dimpsey, R. Arora, and K. Kuiper. Java server performance: A case study of building efficient, scalable jvms. IBM Systems Journal, 39(1):151--174, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. K. Kawachiya, A. Koseki, and T. Onodera. Lock reservation: Java locks can mostly do without atomic operations. In OOPSLA'02: Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 130--141, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Manson, W. Pugh, and S. V. Adve. The java memory model. In POPL'05: Proceedings of the 32nd ACM SIGPLAN-SIGCAT symposium on Principles of programming languages, pages 378--391, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. M. Crummey and M. L. Scott. Scalable reader-writer synchronization for shared-memory multiprocessors. In PPoPP'91: Proceedings of the Third ACM Symposium on Principles and Practice of Parallel Programming, pages 106--113, Apr. 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. T. Onodera and K. Kawachiya. A study of locking objects with bimodal fields. In OOPSLA'99: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 223--237, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Rajwar and J. R. Goodman. Speculative lock elision: enabling highly concurrent multithreaded execution. In Proceedings of the 34th annual ACM/IEEE international symposium on Microarchitecture, pages 294--305, Nov. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Roy, S. Hand, and T. Harris. A runtime system for software lock elision. In Proceedings of the 4th ACM European conference on Computer systems, pages 261--274, Apr. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. K. Russel and D. Detlefs. Eliminating synchronization-related atomic operations with biased locking and bulk locking. In OOPSLA'06: Proceedings of the 21st annual ACM SIGPLAN conference on Object oriented programming systems, languages, and applications, pages 263--272, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. SPECjbb2005. http://www.spec.org/jbb2005/.Google ScholarGoogle Scholar
  16. J. Wetzel, E. Siha, C. May, B. Frey, J. Furukawa, and G. Fraizier. BookII: PowerPC Virtual Environment Architecture.Google ScholarGoogle Scholar
  17. P. Wu, M. M. Michael, C. von Praun, T. Nakaike, R. Bordawekar, H. W. Cain, C. Cascaval, S. Chatterjee, S. Chiras, R. Hou, M. F. Mergen, X. Shen, M. F. Spear, H. Wang, and K. Wang. Compiler and runtime techniques for software transactional memory optimization. Concurrency and Computation: Practice and Experience, 21(1):7--23, Jan. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. L. Ziarek, A. Welc, A.-R. Adl-Tabatabai, V. Menon, T. Shpeisman, and S. Jagannathan. A uniform transactional execution environment for java. In ECOOP'08: Proceedings of the 22nd European conference on Object-Oriented Programming, pages 129--154, July 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lock elision for read-only critical sections in Java

    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
    • Published in

      cover image ACM Conferences
      PLDI '10: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2010
      514 pages
      ISBN:9781450300193
      DOI:10.1145/1806596
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 45, Issue 6
        PLDI '10
        June 2010
        496 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1809028
        Issue’s Table of Contents

      Copyright © 2010 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 5 June 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate406of2,067submissions,20%

    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!