Lightweight monitors for the Java virtual machine
Author(s) -
Yang ByungSun,
Moon SooMook,
Ebcioğlu Kemal
Publication year - 2005
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.635
Subject(s) - computer science , lock (firearm) , operating system , java , java concurrency , hash table , compiler , embedded system , programming language , hash function , real time java , mechanical engineering , engineering
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.