• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2014, Vol. 36 ›› Issue (02): 233-237.

• 论文 • 上一篇    下一篇

一种基于类的Java多线程程序数据竞争静态检测算法

宋东海,贲可荣,张志祥   

  1. (海军工程大学计算机工程系,湖北 武汉 430033)
  • 收稿日期:2013-10-05 修回日期:2013-12-10 出版日期:2014-02-25 发布日期:2014-02-25
  • 基金资助:

    国家自然科学基金资助项目(61272108)

A class-based data race static detection algorithm for Java multithread programs               

SONG Donghai,BEN Kerong,ZHANG Zhixiang   

  1. (Department of Computer Engineering,Naval University of Engineering,Wuhan 430033,China)
  • Received:2013-10-05 Revised:2013-12-10 Online:2014-02-25 Published:2014-02-25

摘要:

多线程并发程序的广泛使用引发了更多的数据竞争问题,竞争检测对于提高软件质量具有重要意义。将竞争静态检测和静态切片分析结合起来,提出了一种基于类的Java数据竞争静态检测算法,该算法利用函数调用层次获得函数调用链,对类域进行分析,找出可能数据竞争,通过静态切片缩小程序分析范围,并结合数据竞争的必要条件,去掉不可能数据竞争。实例表明,该算法可用于指导修复程序中的竞争缺陷。

关键词: 多线程程序, 数据竞争, 程序切片, 静态分析, 竞争检测

Abstract:

The widespread use of multithread concurrent programs induces more detrimental data race problems, race detection is very important for improving software quality. Combining  data race static detection with static program slicing, a classbased  data race static detection algorithm for Java multithread programs is proposed. The algorithm obtains function callchains by using function calls, analyzes every field of a class, finds out possible data race, reduces the range of program analysis through static program slicing, and removes the impossible data race by considering the necessity of data race. An example demonstrates that the proposed algorithm can guide programmers to fix software data race defects.

Key words: multithread program;data race;program slice;static analysis;race detection