基于下推自动机的细粒度锁自动重构方法
作者:
作者单位:

作者简介:

张杨(1980-),男,博士,副教授,CCF高级会员,主要研究领域为软件重构,并发软件分析.
邵帅(1996-),男,硕士生,主要研究领域为并发软件分析,智能化软件.
张冬雯(1964-),女,博士,教授,CCF专业会员,主要研究领域为软件重构,并发软件分析.

通讯作者:

张杨,E-mail:zhangyang@hebust.edu.cn

中图分类号:

TP311

基金项目:

国家自然科学基金(61440012);河北省自然科学基金(18960106D);河北省高等学校科学研究计划(ZD2019093);河北省研究生创新资助项目(CXZZSS2020094)


Automated Refactoring Approach for Fine-grained Lock Based on Pushdown Automaton
Author:
Affiliation:

Fund Project:

National Natural Science Foundation of China (61440012); National Natural Science Foundation of Hebei Province (18960106D); Scientific Research Foundation of Hebei Educational Department (ZD2019093); Innovation Foundation Project of Hebei Province (CXZZSS2020094)

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

    针对粗粒度锁会严重影响并发程序的可伸缩性问题,提出一种面向细粒度锁的自动重构方法.该方法借助访问者模式分析、别名分析、负面效应分析等多种程序分析技术获取临界区代码的读写模式,然后使用下推自动机构建不同锁模式的识别方法,根据识别结果进行代码重构.与以往锁重构方法的不同之处在于,该方法考虑了锁降级模式,使重构适用性更广.基于此方法,在Eclipse JDT框架下,以插件的形式实现了自动重构工具FLock.在实验中,从重构个数、改变的代码行数、重构时间、准确性和重构后程序性能等方面对FLock进行了评估,并与已有的重构工具Relocker和CLOCK进行了对比.对HSQLDB,Jenkins和Cassandra等11个大型实际应用程序的重构结果表明:FLock共重构了1 757个内置监视器对象,每个程序重构平均用时17.5s.该重构工具可以有效地实现粗粒度锁到细粒度锁的转换,与手动重构相比,有效提升了细粒度锁的重构效率.

    Abstract:

    As coarse-grained locks have a negative impact on the scalability of concurrent programs, this study proposes an automatic refactoring approach to convert a coarse-grained lock into a fine-grained one. Several static analyses, such as visitor pattern analysis, alias analysis, and side-effect analysis are employed in this approach. The read and write pattern of a critical section is inferred by side effect analysis, and then a push down automaton is proposed to identify the read and write pattern. Finally, refactoring is conducted based on these results. An automatic tool FLock is implemented as the Eclipse plug-in. The proposed approach is evaluated by eleven open-source projects including HSQLDB, Jenkins, and Cassandra, by presenting results such as the number of refactored locks, changed lines of code, refactoring time, accuracy, program performance after refactoring. FLock is also compared with the existing tools Relocker and CLOCK. The experimental results show that a total of 1757 built-in monitors are refactored and each refactoring takes an average of 17.5 seconds. The experiments reveal that the proposed tool can help developers convert coarse-grained locks into fine-grained locks effectively.

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

张杨,邵帅,张冬雯.基于下推自动机的细粒度锁自动重构方法.软件学报,2021,32(12):3710-3727

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2020-03-04
  • 最后修改日期:2020-06-04
  • 录用日期:
  • 在线发布日期: 2021-12-02
  • 出版日期: 2021-12-06
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号