当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Optimal Prediction of Synchronization-Preserving Races
arXiv - CS - Programming Languages Pub Date : 2020-10-30 , DOI: arxiv-2010.16385
Umang Mathur and Andreas Pavlogiannis and Mahesh Viswanathan

Concurrent programs are notoriously hard to write correctly, as scheduling nondeterminism introduces subtle errors that are both hard to detect and to reproduce. The most common concurrency errors are (data) races, which occur when memory-conflicting actions are executed concurrently. Consequently, considerable effort has been made towards developing efficient techniques for race detection. The most common approach is dynamic race prediction: given an observed, race-free trace $\sigma$ of a concurrent program, the task is to decide whether events of $\sigma$ can be correctly reordered to a trace $\sigma^*$ that witnesses a race hidden in $\sigma$. In this work we introduce the notion of sync(hronization)-preserving races. A sync-preserving race occurs in $\sigma$ when there is a witness $\sigma^*$ in which synchronization operations (e.g., acquisition and release of locks) appear in the same order as in $\sigma$. This is a broad definition that strictly subsumes the famous notion of happens-before races. Our main results are as follows. First, we develop a sound and complete algorithm for predicting sync-preserving races. For moderate values of parameters like the number of threads, the algorithm runs in $\widetilde{O}(\mathcal{N})$ time and space, where $\mathcal{N}$ is the length of the trace $\sigma$. Second, we show that the problem has a $\Omega(\mathcal{N}/\log^2 \mathcal{N})$ space lower bound, and thus our algorithm is essentially time and space optimal. Third, we show that predicting races with even just a single reversal of two sync operations is $\operatorname{NP}$-complete and even $\operatorname{W}[1]$-hard when parameterized by the number of threads. Thus, sync-preservation characterizes exactly the tractability boundary of race prediction, and our algorithm is nearly optimal for the tractable side.

中文翻译:

保持同步的比赛的最优预测

众所周知,并发程序很难正确编写,因为调度不确定性会引入难以检测和重现的细微错误。最常见的并发错误是(数据)竞争,当并发执行内存冲突操作时会发生这种情况。因此,已经为开发用于种族检测的有效技术做出了相当大的努力。最常见的方法是动态竞争预测:给定一个并发程序的观察到的无竞争跟踪 $\sigma$,任务是确定 $\sigma$ 的事件是否可以正确地重新排序到跟踪 $\sigma^* $ 见证隐藏在 $\sigma$ 中的比赛。在这项工作中,我们引入了同步(时间化)保留种族的概念。当存在见证 $\sigma^*$ 的同步操作(例如,锁的获取和释放)以与 $\sigma$ 中相同的顺序出现。这是一个广义的定义,严格包含了著名的发生在种族之前的概念。我们的主要结果如下。首先,我们开发了一个完善的算法来预测同步保持竞争。对于线程数等参数的中等值,该算法在 $\widetilde{O}(\mathcal{N})$ 时间和空间中运行,其中 $\mathcal{N}$ 是轨迹的长度 $\sigma $. 其次,我们证明该问题具有 $\Omega(\mathcal{N}/\log^2 \mathcal{N})$ 空间下界,因此我们的算法本质上是时间和空间最优的。第三,我们表明,当通过线程数参数化时,即使只是两个同步操作的单个反转来预测竞争也是 $\operatorname{NP}$-complete 甚至 $\operatorname{W}[1]$-hard。因此,
更新日期:2020-11-02
down
wechat
bug