摘要
针对多线程并发程序中的数据竞争问题,本文提出了一种基于Java抽象语法树的数据竞争修复办法。首先利用抽象语法树对需要进行插锁的ast节点进行查找,这一过程包括:寻找发生数据竞争的变量所在方法;对发生数据竞争的变量所在的语句进行搜索;对需要加锁的位置进行确定。找到加锁位置后,对需要加锁的位置进行自动加锁操作,从而实现对数据竞争问题的自动修复。
In order to solve the problem of data competition in multi-thread concurrent programs, this paper proposes a method of repairing data competition based on Java abstract syntax tree. Firstly, the abstract syntax tree is used to find the ast nodes which need to be interlocked. This process includes: finding the method of finding the variables in which the data competition occurs, searching the statements of the variables in which the data competition occurs, and searching the statements of the variables in which the data competition takes place. Determine the location where the lock is required. After finding the locked position, we can automatically fix the problem of data competition by automatically locking the position that needs to be locked.
作者
张晓萱
赵钰玮
李天慧
常琳珂
孙瑞男
ZHANG Xiao-xuan;ZHAO Yu-wei;LI Tian-hui;CHANG Lin-ke;SUN Rui-nan(College of Information Science and Engineering, Hebei University of Science and Technology, Shijiazhuang Hebei 050000)
出处
《数字技术与应用》
2019年第3期58-59,共2页
Digital Technology & Application
关键词
并发程序
数据竞争
抽象语法树
重构
concurrent program
data competition
abstract syntax tree
reconstruction