一句话:提出多项式时间且无假阳性的动态数据竞争预测算法 M²,对两进程完备并可动态判定完备性。
并发程序因进程间通信的不确定性极易出错,数据竞争是关键错误指示。本文研究基于锁的并发程序的数据竞争预测:给定并发轨迹,找出所有构成竞争的事件对。现有多项式时间可靠算法极不完备,可能漏掉简单竞争。作者提出 M² 算法,保持多项式时间且无假阳性;对两进程轨迹可证明完备,并给出多进程下动态判定完备性的充分条件。在近期挑战性基准上,M² 报告数百个真实竞争,许多为现有方法遗漏;借助动态判据,它判定已发现全部竞争,运行时间与理论上最快但高度不完备的方法相当且常更短。
Writing concurrent programs is highly error-prone due to the nondeterminism in interprocess communication. The most reliable indicators of errors in concurrency are data races , which are accesses to a shared resource that can be executed concurrently. We study the problem of predicting data races in lock-based concurrent programs. The input consists of a concurrent trace t , and the task is to determine all pairs of events of t that constitute a data race. The problem lies at the heart of concurrent verification and has been extensively studied for over three decades. However, existing polynomial-time sound techniques are highly incomplete and can miss simple races. In this work we develop M 2: a new polynomial-time algorithm for this problem, which has no false positives. In addition, our algorithm is complete for input traces that consist of two processes, i.e., it provably detects all races in the trace. We also develop sufficient criteria for detecting completeness dynamically in cases of more than two processes. We make an experimental evaluation of our algorithm on a challenging set of benchmarks taken from recent literature on the topic. Our algorithm soundly reports hundreds of real races, many of which are missed by existing methods. In addition, using our dynamic completeness criteria, M 2 concludes that it has detected all races in the benchmark set, hence the reports are both sound and complete. Finally, its running times are comparable, and often smaller than the theoretically fastest, yet highly incomplete, existing methods. To our knowledge, M 2 is the first sound algorithm that achieves such a level of performance on both running time and completeness of the reported races.