线性时间下的可靠动态死锁预测
Sound Dynamic Deadlock Prediction in Linear Time
AI总结:
本文证明了可靠且完备的死锁预测难解性,提出“保持同步死锁”新概念,并设计了两种线性时间的可靠死锁预测算法,适用于离线与在线监控场景。
摘要:
死锁是最臭名昭著的并发错误之一,大量研究致力于高效地检测它们。动态预测分析通过观察并发执行,并对可能见证并发错误的替代交错进行推理来工作。这类技术具备可扩展性和可靠的错误报告能力,已成为数据竞争等并发错误检测的有效方法。然而,有效的动态死锁预测已被证明是一项具有挑战性的任务,因为目前没有死锁预测器能同时满足可靠性、高精度和高效性的要求。在本文中,我们首先正式证明了这种权衡是不可避免的,我们展示了:可靠且完备的死锁预测一般是难解的;即使是确定潜在死锁是否存在这一看似更简单的任务(通常作为实际可预测死锁的不可靠见证),也是难解的。本工作的主要贡献是一类新的可预测死锁,称为保持同步死锁。非正式地说,这些死锁可以通过对观察到的执行进行重排序来预测,同时保持冲突临界区的相对顺序。我们提出了两种基于此概念进行可靠死锁预测的算法。我们的第一个算法SPDOffline检测所有保持同步死锁,每个抽象死锁模式的运行时间是线性的,抽象死锁模式也是本工作引入的一个新概念。我们的第二个算法SPDOnline以严格在线的方式预测所有涉及两个线程的保持同步死锁,总体运行时间为线性,更适合运行时监控场景。我们实现了这两种算法,并在标准基准测试的大型数据集上评估了它们执行离线和在线死锁预测的能力。
英文摘要:
Deadlocks are one of the most notorious concurrency bugs, and significant research has focused on detecting them efficiently. Dynamic predictive analyses work by observing concurrent executions, and reason about alternative interleavings that can witness concurrency bugs. Such techniques offer scalability and sound bug reports, and have emerged as an effective approach for concurrency bug detection, such as data races. Effective dynamic deadlock prediction, however, has proven a challenging task, as no deadlock predictor currently meets the requirements of soundness, high-precision, and efficiency. In this paper, we first formally establish that this tradeoff is unavoidable, by showing that (a) sound and complete deadlock prediction is intractable, in general, and (b) even the seemingly simpler task of determining the presence of potential deadlocks, which often serve as unsound witnesses for actual predictable deadlocks, is intractable. The main contribution of this work is a new class of predictable deadlocks, called sync(hronization)-preserving deadlocks. Informally, these are deadlocks that can be predicted by reordering the observed execution while preserving the relative order of conflicting critical sections. We present two algorithms for sound deadlock prediction based on this notion. Our first algorithm SPDOffline detects all sync-preserving deadlocks, with running time that is linear per abstract deadlock pattern, a novel notion also introduced in this work. Our second algorithm SPDOnline predicts all sync-preserving deadlocks that involve two threads in a strictly online fashion, runs in overall linear time, and is better suited for a runtime monitoring setting. We implemented both our algorithms and evaluated their ability to perform offline and online deadlock-prediction on a large dataset of standard benchmarks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。