A study of locking objects with bimodal fields
- 1 October 1999
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 34 (10), 223-237
- https://doi.org/10.1145/320384.320405
Abstract
Object locking can be efficiently implemented by bimodal use of a field reserved in an object. The field is used as a lightweight lock in one mode, while it holds a reference to a heavyweight lock in the other mode. A bimodal locking algorithm recently proposed for Java achieves the highest performance in the absence of contention, and is still fast enough when contention occurs.However, mode transitions inherent in bimodal locking have not yet been fully considered. The algorithm requires busy-wait in the transition from the light mode (inflation), and does not make the reverse transition (deflation) at all.We propose a new algorithm that allows both inflation without busy-wait and deflation, but still maintains an almost maximum level of performance in the absence of contention. We also present statistics on the synchronization behavior of real multithreaded Java programs, which indicate that busy-wait in inflation and absence of deflation can be problematic in terms of robustness and performance. Actually, an implementation of our algorithm shows increased robustness, and achieves performance improvements of up to 13.1% in server-oriented benchmarks.Keywords
This publication has 10 references indexed in Scilit:
- An efficient meta-lock for implementing ubiquitous synchronizationPublished by Association for Computing Machinery (ACM) ,1999
- Architecture and performance evaluation of a massive multi-agent systemPublished by Association for Computing Machinery (ACM) ,1999
- Monitors and exceptions: how to implement Java efficientlyConcurrency: Practice and Experience, 1998
- Thin locksPublished by Association for Computing Machinery (ACM) ,1998
- Shared memory consistency models: a tutorialComputer, 1996
- Waiting algorithms for synchronization in large-scale multiprocessorsACM Transactions on Computer Systems, 1993
- Empirical studies of competitve spinning for a shared-memory multiprocessorPublished by Association for Computing Machinery (ACM) ,1991
- Algorithms for scalable synchronization on shared-memory multiprocessorsACM Transactions on Computer Systems, 1991
- The performance of spin lock alternatives for shared-money multiprocessorsIEEE Transactions on Parallel and Distributed Systems, 1990
- Experience with processes and monitors in MesaCommunications of the ACM, 1980