Font Size: a A A

Research On Java's Synchronization Optimization Based On Escape Analysis

Posted on:2011-09-13Degree:MasterType:Thesis
Country:ChinaCandidate:W HuFull Text:PDF
GTID:2178360308470753Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Writing a correct program is not easy while writing a correct concurrent program is even harder. Compared with the sequential program, the concurrent program is clearly more prone to error. Meanwhile, with the increase in the number of processors, the effective use of concurrency will become more and more important. For the purpose of supporting concurrent programming, Java provides the powerful multi-threaded technology which can help programmers produce greatly effective, robust, safe, and sound concurrent programs. Moreover, in order to make sure that each thread can implement atom manipulations properly, Java introduces the thread synchronization mechanism, which can realize mutually exclusive access to shared resources for multiple threads by locking on the shared data.Although the coarse-grained locking mechanism can help programmers generate correct codes, the overhead of synchronization operation itself is high and in practical applications, there are a large quantity of unnecessary synchronization operations due to its pessimism and conservation. So the performance of the whole program will degrade obviously. To ensure the accuracy of concurrent programs and reduce the synchronization overhead simultaneously when programs are running, we propose a new synchronization optimization algorithm based on escape analysis, which has been implemented in the Soot, an open source Java bytecode optimization framework. Focusing on the synchronization optimization, this paper mainly depicts and discusses the following work:(1) Propose a context-sensitive, flow-insensitive, and inter-procedural escape analysis algorithm, based on points-to analysisThrough the points-to analysis, the algorithm can get reachability information of objects and object references. Then, using the decision rules for thread-escape and the merging rules for escape status, the algorithm can propagate intra-procedurally and inter-procedurally the escape status of static fields and thread fields in the whole Java program and Java libraries. Thus it can identity those objects accessed by only one thread and then remove synchronization operations on them. In chapterⅢ, we provide detailed descriptions of the algorithm.(2) Implement our synchronization optimization algorithm in "closed world" based on escape analysisIn this paper, we use Soot framework to realize the escape analysis based on points-to analysis described above. Specific steps are as follows:Firstly, we use SPARK, which is a built-in points-to analysis framework of Soot, to do necessary points-to analysis. Secondly, we extend the flow analysis framework of Soot to do effective data flow analysis to implement the synchronization optimization algorithm. For SPECjvm98 benchmarks,15.7% to 99.2% (with a median of 55.9%) of synchronization operations are eliminated, In chapterⅣ, we provide detailed descriptions of the algorithm implementation.
Keywords/Search Tags:multi-threads, synchronization optimization, escape analysis, points-to analysis, Soot, synchronization elimination
PDF Full Text Request
Related items