Lightweight monitors for the Java virtual machine

  • Authors:
  • Byung-Sun Yang;Soo-Mook Moon;Kemal Ebcioğlu

  • Affiliations:
  • School of Electrical Engineering, Seoul National University, Kwanak, P.O. Box 34, Seoul 151-742, Korea;School of Electrical Engineering, Seoul National University, Kwanak, P.O. Box 34, Seoul 151-742, Korea;IBM T. J. Watson Research Center, P.O. Box 704, Yorktown Heights, NY 10598, U.S.A.

  • Venue:
  • Software—Practice & Experience - Research Articles
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

Java supports the monitor construct for language-level synchronization in the context of multi-threading. This paper introduces the lightweight monitor, an efficient user-level monitor implementation. The lightweight monitor is useful for single-threaded Java programs as well as for multi-threaded Java programs with little lock contention. A 32-bit lock is embedded in each object for efficient lock access while other monitor data structures are managed using a hash table. We highly optimized the lock manipulation code, which is translated and inlined by a just-in-time (JIT) compiler. In the most probable cases, only nine SPARC instructions are spent for lock acquisition and five instructions are spent for lock release. Our experimental results indicate that the lightweight monitor is faster than the monitor implementation in the SUN JDK 1.2 RC1 by up to 21 times in the absence of lock contention and by up to seven times in the presence of lock contention. Copyright © 2004 John Wiley & Sons, Ltd.This is a revised and expanded version of a paper published in the Third Workshop on Interaction Between Compilers and Computer Architectures, October 1998