首页 | 本学科首页   官方微博 | 高级检索  
     检索      

面向异步机制的自动重构方法研究
引用本文:纪铭涵,齐 林,张 杨,董士程,李朝帅.面向异步机制的自动重构方法研究[J].河北科技大学学报,2021,42(5):499-507.
作者姓名:纪铭涵  齐 林  张 杨  董士程  李朝帅
作者单位:河北科技大学信息科学与工程学院,河北石家庄 050018
基金项目:国家自然科学基金(61440012);河北省自然科学基金(18960106D);河北省高等学校科学研究计划重点项目(ZD2019093)
摘    要:为了解决并行处理中同步阻塞会浪费系统资源和影响程序性能的问题,提出了一种基于CompletableFuture异步机制的自动重构方法。首先,使用WALA静态程序分析工具进行访问者模式分析、逃逸分析、别名分析以及数据流分析等静态程序分析技术,确定共享变量数据的操作方式;然后,基于CompletableFuture机制设置4种异步重构模式;最后,根据不同模式实现异步机制的自动重构。基于此方法,在Eclipse平台下开发了自动重构工具AsynRef,并对HSQLDB,Jenkins, JGroups和SPECjbb2005等4个大型实际应用程序进行自动重构,从重构个数、改变的代码行数、准确性和重构后程序性能等方面对AsynRef进行评估,对4个程序所包含的919个同步方法共完成387个异步机制转换。结果显示,使用AsynRef进行异步机制重构后,程序执行性能有8%到39%的不同程度的提升。AsynRef可以有效完成代码异步化自动重构,与传统手动重构相比,有效提升了异步化的重构效率。

关 键 词:并行处理  同步机制  异步机制  静态程序分析  自动重构
收稿时间:2021/6/15 0:00:00
修稿时间:2021/9/22 0:00:00

An automated refactoring approach for asynchronous mechanism
JI Minghan,QI Lin,ZHANG Yang,DONG Shicheng,LI Chaoshuai.An automated refactoring approach for asynchronous mechanism[J].Journal of Hebei University of Science and Technology,2021,42(5):499-507.
Authors:JI Minghan  QI Lin  ZHANG Yang  DONG Shicheng  LI Chaoshuai
Abstract:As synchronous blocking wastes system resources and affects program performance in concurrent processing,an automatic refactoring approach based 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 were used in this approach,so that the operation mode of shared variable data was determined.Then four asynchronous refactoring modes were set based on the asynchronous mechanism of CompletableFuture.Finally,the code was 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 were automatically refactored by AsynRef.AsynRef was evaluated via the number of refactored locks,changed lines of code,accuracy,program performance after refactoring.Among the 919 synchronous methods contained in the four programs,387 asynchronous mechanism conversions were completed.After Asynref was used for asynchronous mechanism refactoring,the program execution performance was improved by 8% to 39%.AsynRef can refactor for aynchronized mechanism effectively.Compared to manual refactoring,the refactoring efficiency is improved significantly.
Keywords:concurrent processing  synchronization mechanism  asynchronous mechanism  static program analysis  automatic refactoring
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《河北科技大学学报》浏览原始摘要信息
点击此处可从《河北科技大学学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号