TO-Lock: removing lock overhead using the owners' temporal locality

The performance of locking is critical, as programming languages with built-in thread support are coming into wide use. Many techniques for optimizing Java monitors have been proposed, based on the observation that the locks are rarely contended for in many applications. However, the problem of the performance degradation in SMP environments caused by necessary serializations of the processors' execution has not been addressed for shared objects. We propose a new algorithm for this problem. It uses simple instructions to acquire the lock by exploiting the owner locality for objects even if the ownership has migrated among the threads. Our algorithm is particularly effective for SMP environments because we can remove the overhead of the serialization caused by complex atomic operations for uncontended locks by allowing the lock operation and the code protected by the lock to be executed in parallel. We verified the safety of the algorithm by using a software tool, Spin. The experimental results of our benchmarking on an SMP machine using Intel Xeon processors showed that our algorithm can significantly improve the performance by 83% on average compared to the case using a complex atomic instruction.

[1]  Y. S. Ramakrishna,et al.  An efficient meta-lock for implementing ubiquitous synchronization , 1999, OOPSLA '99.

[2]  Mauricio J. Serrano,et al.  Thin locks: featherweight Synchronization for Java , 2004, SIGP.

[3]  Gerard J. Holzmann,et al.  The Model Checker SPIN , 1997, IEEE Trans. Software Eng..

[4]  Kiyokuni Kawachiya,et al.  Lock reservation: Java locks can mostly do without atomic operations , 2002, OOPSLA '02.

[5]  Òòòðð,et al.  Shared-memory Mutual Exclusion: Major Research Trends Since 1986 , 1986 .

[6]  Rajiv Arora,et al.  Java server performance: A case study of building efficient, scalable Jvms , 2000, IBM Syst. J..

[7]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[8]  Kiyokuni Kawachiya,et al.  A study of locking objects with bimodal fields , 1999, OOPSLA '99.

[9]  Michael H. Kalantar,et al.  Java server benchmarks , 2000, IBM Syst. J..

[10]  David Dice,et al.  Implementing Fast Java Monitors with Relaxed-Locks , 2001, Java Virtual Machine Research and Technology Symposium.

[11]  James H. Anderson,et al.  Shared-memory mutual exclusion: major research trends since 1986 , 2003, Distributed Computing.

[12]  Leslie Lamport,et al.  A fast mutual exclusion algorithm , 1987, TOCS.

[13]  Laurie J. Hendren,et al.  SableVM: A Research Framework for the Efficient Execution of Java Bytecode , 2001, Java Virtual Machine Research and Technology Symposium.

[14]  Mike Johnson,et al.  Superscalar microprocessor design , 1991, Prentice Hall series in innovative technology.

[15]  Andreas Krall,et al.  Monitors and Exceptions: How to Implement Java Efficiently , 1998, Concurr. Pract. Exp..

[16]  Erez Petrank,et al.  Thread-local heaps for Java , 2002, ISMM '02.