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

J4 ›› 2010, Vol. 32 ›› Issue (3): 111-114.doi: 10.3969/j.issn.1007130X.2010.

• 论文 • 上一篇    下一篇

基于Java内存模型的并发程序模型检测

周志远, 张大方, 缪力   

  1. (湖南大学软件学院,湖南 长沙 410082)
  • 收稿日期:2009-01-02 修回日期:2009-03-27 出版日期:2010-03-10 发布日期:2010-03-10
  • 通讯作者: 周志远 E-mail:galahadzzy@yahoo.com.cn
  • 作者简介:周志远(1984),男,湖南长沙人,硕士生,研究方向为程序分析和模型检测;张大方,博士,教授,博士生导师,研究方向为可信系统与网络、软件测试等;缪力,博士,研究方向为软件测试和软件工程等。

Model Checking the Concurrent Programs Based on the Java Memory Model

ZHOU Zhi-Yuan, ZHANG Da-Fang, JIU Li   

  1. (School of Software,Hunan University,Changsha 410082)
  • Received:2009-01-02 Revised:2009-03-27 Online:2010-03-10 Published:2010-03-10
  • Contact: ZHOU Zhi-Yuan E-mail:galahadzzy@yahoo.com.cn

摘要: 为了提高性能,Java内存模型允许编译器在优化过程中改变代码的执行顺序,同时该技术也会造成共享数据的更新顺序与本来的执行顺序不同。在多线程Java并发程序中,这些代码乱序执行会引起很多难以发现的错误。现有的Java程序模型检测技术并没有考虑这些顺序改变的问题。因此,本文提出了一种建立包含多线程交互及线程内代码乱序执行的完整模型,并利用模型检测工具进行穷举检测的算法。该算法可以发现原有技术无法发现的新问题,更好地检测高可靠性要求的Java并发程序。

关键词: Java内存模型, 模型检测, Java并发程序, 多线程, 软件测试

Abstract: In order to improve the performance, the Java Memory Model allows the compiler to change the execution order. A variety of caches will change the modification order of the shared data too. In multithreaded concurrent Java programs, this “out of order” will cause lots of problems which are hard to detect. The existing Java model checking techniques do not consider these order changes. Therefore, this paper proposes an approach which builds a complete model including thread interactions and “out of order” execution in a single thread. This algorithm can find problems which are omitted by the existing method, as well as check and verify the programs which require high reliability better.

Key words: Java memory model;model checking;concurrent Java program;multithreaded;software testing

中图分类号: