摘要
通过使用词法分析和语法分析进行线程并行程序数据竞争静态检测,根据规则将源代码数据竞争相关信息映射到XML文件,解决多个线程程序因可以随机访问共享变量而导致运行结果不确定性,容易引发数据竞争等问题。通过XQuery查询语言获取XML映射模型中的数据访问信息,将信息存储于数据竞争表示层。通过竞争图生成算法建立数据竞争有向图模型,利用拓扑排序检测数据竞争的具体位置,获取所有竞争序列。实验结果表明,该检测方法能够准确快速地发现多线程程序中的数据竞争并在源文件中进行准确定位。
The lexical analysis and syntax analysis were used to carry out the Multi-thread parallel program data race static detec-tion. According to the rules of data-race, the problems that all shared variables can be freely accessed in multi-thread programs? generating uncertainty of the running results, easily causing data-race, atomic violations and dead-locks to the program were solved. All shared variables access information was extracted from the XML mapping model by XQuery language and saved into data-race presentation layer. Data race directed graph model was constructed according to data-race graph, and the concrete data- race position was detected with topological sort algorithm to extract all data-race sequence. Experimental results show that the detection method can accurately and quickly find data-races in multi-thread programs and can accurately locate their positions in the source code file.
作者
陈俊
周宽久
贾敏
CHEN Jun ZHOU Kuan-jiu JIA Min(School of Education Science, Guizhou Normal University, Guiyang 550001, China School of Software Engineering, Dalian University of Technology, Dalian 116024, China School of Economics and Management, Beijing Electronic Science and Technology Vocational College, Beijing 100029, China)
出处
《计算机工程与设计》
北大核心
2017年第5期1264-1272,共9页
Computer Engineering and Design
基金
贵州省科学技术基金项目(黔科合协字师大LH字[2014]7040号)