Font Size: a A A

An Automated Refactoring Approach For Asynchronous Mechanism

Posted on:2022-05-13Degree:MasterType:Thesis
Country:ChinaCandidate:M H JiFull Text:PDF
GTID:2518306737478864Subject:Computer technology
Abstract/Summary:PDF Full Text Request
As an important way to ensure the correctness of concurrent program state and program data,synchronization mechanism have been widely concerned.However,due to the existence of unnecessary synchronization control,the use of a coarse-grained synchronization mechanism will also increase the overhead and reduce the execution efficiency.The asynchronous can also achieve parallel execution of programs.Using asynchronous mechanisms can effectively avoid the blocking effect of synchronous mechanisms and further improve the performance of programs.At present,the research on asynchronous programming has been applied to many fields.Compared with the use of synchronous code,asynchronous programming is more complex in code implementation.In asynchronous programming,using automatic tools to realize asynchronous code conversion can reduce the errors that may be introduced by manually rewriting the code,and greatly reduce the workload of developers.Further research is needed on the circumstances under which code asynchronous conversion is needed and the ways to refactor the code.As synchronization blocking will waste system resources and program performance in concurrent processing,an automatic refactoring approach on the asynchronous mechanism of CompletableFuture was proposed.Firstly,several static analyses by Wala static program analysis tool,such as visitor pattern analysis,alias analysis,and data flow analysis are used in this approach.Secondly,the operation mode of shared variable data is determined,and then four asynchronous refactoring modes are set based on the asynchronous mechanism of CompletableFuture.Finally,the code is refactored according to different modes.An automatic tool AsynRef was implemented by Eclipse and four large-scale practical applications such as HSQLDB,Jenkins,JGroups,and SPECjbb2005 are automatically refactored by AsynRef.AsynRef is evaluated via the number of refactored locks,changed lines of code,accuracy,program performan after refactoring.The experimental results show that AsynRef can effectively complete the asynchronous refactoring of code and save time and effort compared with the traditional manual refactoring.
Keywords/Search Tags:Concurrent processing, Synchronization mechanism, Asynchronous mechanism, Static analysis, Automatic refactoring
PDF Full Text Request
Related items