Font Size: a A A

Research And Implementation Of Software Refactoring Method For Multi-thread Mechanism

Posted on:2017-06-26Degree:MasterType:Thesis
Country:ChinaCandidate:C G LiuFull Text:PDF
GTID:2348330512955433Subject:Computer technology
Abstract/Summary:PDF Full Text Request
With the popularity and continus development of multi-core/many-core processor,concurrent/parallel programming is becoming the main programming approach to improve the performance of multi-core processor system.In the process of concurrent/parallel programming,thread is widely used by more and more people.Several multi-thread mechanism is provided by Java,including Thread,Executor and Fork/Join framework.It has become a major problem for programmers to choose a kind of multi-thread mechanism which can make the concurrent/parallel program better maintain and develop its performance.The multi-thread mechanism in Java is different in the thread management pattern,code and the performance in executing program.This paper researches on multi-thread mechanism,such as Thread,Executor,Fork/Join framework,and presents an automated refactoring method oriented to Java multi-thread mechanism.This method can implement automatic refactoring from Thread to Executor and help the program developers to choose a more suitable thread mechanism.In this method,the pre-conditions of refactoring are designed by software static analysis.The refactoring logic of discovering and refactoring the program code is designed by abstract syntax tree mechanism in this method.To test the validity of the refactoring method,an automated refactoring tool named Rethreader is implemented in the enviroment of Eclipse JDT.The program code is parsed into an abstract syntax tree by Rethreader.Each part of the program code is regarded as a node in the abstract syntax tree.The code refactoring is completed by traversing,filtering,deleting and modifying the node.In the experiments,the refactoring function of Rethreader is tested based on several programs in the Java Grande Form(JGF),including series,crypt,sparsematmult,lufact,sor and montecarlo.The experimental results show that the Rethreader can successfully implement the automatic refactoring from Thread to Executor and help the programmers to choose different thread mechanism,thereby improve the efficiency of multi-thread programming.
Keywords/Search Tags:Software refactoring, Multi-thread mechanism, Software analysis, Abstract syntax tree, Automated refactoring tool
PDF Full Text Request
Related items