A Study of Locking Objects with Bimodal Fields

Copyright © (1999) by Association for Computing Machinery, Inc. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distrubuted for profit or commericial advantage. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee.

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 the reference to a heavyweight lock in the other mode. A bimodal object-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 above 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 indicates that busy-wait in inflation
and absence of deflation can be problematic. An initial implementation of our algorithm shows promising results in terms of increased robustness and improved performance.

By: Tamiya Onodera and Kiyokuni Kawachiya

Published in: ACM SIGPLAN Notices, volume 34, (no 10), pages 223-237 in 1999

LIMITED DISTRIBUTION NOTICE:

This Research Report is available. This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and specific requests. After outside publication, requests should be filled only by reprints or legally obtained copies of the article (e.g., payment of royalties). I have read and understand this notice and am a member of the scientific community outside or inside of IBM seeking a single copy only.

rt0269.pdf

Questions about this service can be mailed to reports@us.ibm.com .