Java监视器的硬件支持及其操作算法
JAVA MONITOR’S HARDWARE SUPPORT AND OPERATING ALGORITHM
-
摘要: 为支持线程间的同步 ,Java虚拟机中引入了监视器进入与退出指令 ,但这会在大部分的 Java程序中产生严重的性能问题 .在目前的软件实现方法中 ,存在内存开销大或性能较低等问题 ,因此 ,pico Java内核对监视器进行了硬件支持 ,能大大提高性能 ,降低内存开销 ,但是 ,它却存在进入命中率较低的问题 .根据 Java程序中监视器操作具有再入频率低但局部性好的特征 ,提出了一种高效的硬件支持方案及相应算法 ,有效地提高了命中率 ,具有更好的性能 .Abstract: To support the synchronization between the threads, the monitor enter and monitor exit bytecodes were deployed in a Java virtual machine, but this may introduce serious performance problems in many Java programs. Because the current software solutions may consume a lot of memory or lead to low performance, the picoJava core of Sun Microsystems supports the monitor operations in hardware. This technique can increase the monitor instructions’ performance significantly and reduce memory cost, but there is a high miss ratio when the monitors are entered. During the monitor operations in Java programs, the frequency of repeatedly entering a monitor is low but the monitor’s locality is obvious. Because of this characteristic, an effective support scheme in hardware and the corresponding operating algorithm are proposed in this paper, which can improve the hit ratio effectively and achieve a better performance.
下载: