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.
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- P.-J. Courtois, F. Heymans, and D. L. Parnas. Concurrent control with "readers" and "writers". Commun. ACM, 14(10):667--668, Oct. 1971. Google Scholar
Digital Library
- D. Dice. Seqlocks in java -- readers shouldn't write synchronization metadata. David Dice's Weblog, Sept. 2006.Google Scholar
- 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 Scholar
Digital Library
- E. W. Dijkstra. Solution of a problem in concurrent programming control. Commun. ACM, 8(9):569, Sept. 1965. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- SPECjbb2005. http://www.spec.org/jbb2005/.Google Scholar
- J. Wetzel, E. Siha, C. May, B. Frey, J. Furukawa, and G. Fraizier. BookII: PowerPC Virtual Environment Architecture.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Lock elision for read-only critical sections in Java
Recommendations
Lock elision for read-only critical sections in Java
PLDI '10It 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 ...
Lock reservation: Java locks can mostly do without atomic operations
OOPSLA '02: Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applicationsBecause of the built-in support for multi-threaded programming, Java programs perform many lock operations. Although the overhead has been significantly reduced in the recent virtual machines, One or more atomic operations are required for acquiring and ...
Lock reservation: Java locks can mostly do without atomic operations
Because of the built-in support for multi-threaded programming, Java programs perform many lock operations. Although the overhead has been significantly reduced in the recent virtual machines, One or more atomic operations are required for acquiring and ...







Comments