Font Size: a A A

A Study On Java's Synchronization Optimization Based On Just-In-Time Compiler

Posted on:2010-06-05Degree:MasterType:Thesis
Country:ChinaCandidate:C R ShiFull Text:PDF
GTID:2178360302459535Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Along with the advent and popularity of new parallel architecture, it is more and more obvious that the form of mainstream applications shift from single-thread to multi-threads. However, it is well-known that it not easy to generate effective, strong, safe, and sound parallel application, and the design and implementation of the concurrent synchronization strategy is the key problem. One of the primary ways to implement synchronization between multi-threads is to lock the shared data. Lock can protect the shared data safely simply and effectively, but the overhead of lock operation itself is high and in realistic applications, there are a great deal of redundant lock operations due to its pessimism and conseration, so that the whole performance will be reduced obviously.To make up the shortage of the synchronization mechanism of lock, we put forward two synchronization optimization algorithms based on lock coalescence, and introduce some other strategys to optimize the synchronization mechanism of lock in this article. We also implement the two new algorithms in the Just-In-Time compiler of Harmony platform. Focusing on the optimization of synchronization mechanism of lock, this article mainly depicts and discusses the following works:1. Design and implement an instrumentation&sample system in a realistic Java virtual machine HarmonyWe design the instrumentation&sample system in order to collect run-time information such as the executing times of various synchronization operations, etc. This information can help developers to debug, analyse and assess the effect of synchronization optimization algorithm.2. Implement Stoodley's synchronization optimization algorithm based on lock coalescence in HarmonyStoodley's algorithm can remove the inner synchronization optimizations of nested synchronization optimizations and unify the sequential forms of repetitive synchronization within procedure so that the number of synchronization optimizations can be reduced. Designing and implementing the algorithm in Harmony may help to provide new ideas of better algorithm.3. Put forward an algorithm to hoist synchronization operations from loops with Just-in-Time Compiler and implemente it in Harmony The algorithm hoists synchronization operations from loops, greatly decrease synchronization operations at run-time and the optimization opertunities within procedure are fully exploited. We implement the algorithm as an optimization pass of Harmony's Just-In-Time Compiler. The experiment results show that it can improve the throughputs of specjbb2005 by 1%~3%.4. Put forward an optimization framework for synchronized methodThe purpose of the framework is to find out the synchronized method callsites which are unnecessary to call synchronized methods and make them call the non-synchronized ones. We implement an algorithm based on the framework in Harmony and the experiment results show that it can improve the throughputs of specjbb2005 by 2%~4%.
Keywords/Search Tags:Java, Just-In-Time compiler, multi-threads, lock, synchronization operation, synchronizeation optimization
PDF Full Text Request
Related items