面向异步机制的自动重构方法研究
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

国家自然科学基金(61440012);河北省自然科学基金(18960106D);河北省高等学校科学研究计划重点项目(ZD2019093)


An automated refactoring approach for asynchronous mechanism
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    为了解决并行处理中同步阻塞会浪费系统资源和影响程序性能的问题,提出了一种基于CompletableFuture异步机制的自动重构方法。首先,使用WALA静态程序分析工具进行访问者模式分析、逃逸分析、别名分析以及数据流分析等静态程序分析技术,确定共享变量数据的操作方式;然后,基于CompletableFuture机制设置4种异步重构模式;最后,根据不同模式实现异步机制的自动重构。基于此方法,在Eclipse平台下开发了自动重构工具AsynRef,并对HSQLDB,Jenkins,JGroups和SPECjbb2005等4个大型实际应用程序进行自动重构,从重构个数、改变的代码行数、准确性和重构后程序性能等方面对AsynRef进行评估,对4个程序所包含的919个同步方法共完成387个异步机制转换。结果显示,使用AsynRef进行异步机制重构后,程序执行性能有8%到39%的不同程度的提升。AsynRef可以有效完成代码异步化自动重构,与传统手动重构相比,有效提升了异步化的重构效率。

    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.

    参考文献
    相似文献
    引证文献
引用本文

纪铭涵,齐 林,张 杨,董士程,李朝帅.面向异步机制的自动重构方法研究[J].河北科技大学学报,2021,42(5):499-507

复制
分享
相关视频

文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2021-06-15
  • 最后修改日期:2021-09-22
  • 录用日期:
  • 在线发布日期: 2021-11-04
  • 出版日期:
文章二维码