Data races are among the most common bugs in concurrency. The standard approach to data-race detection is via dynamic analyses, which work over executions of concurrent programs, instead of the program source code. The rich literature on the topic has created various notions of dynamic data races, which are known to be detected efficiently when certain parameters (e.g., number of threads) are small. However, the \emph{fine-grained} complexity of all these notions of races has remained elusive, making it impossible to characterize their trade-offs between precision and efficiency. In this work we establish several fine-grained separations between many popular notions of dynamic data races. The input is an execution trace with $N$ events, $T$ threads and $L$ locks. Our main results are as follows. First, we show that happens-before (HB) races can be detected in $O(N\cdot \min(T, L))$ time, improving over the standard $O(N\cdot T)$ bound when $L=o(T)$. Moreover, we show that even reporting an HB race that involves a read access is hard for 2-orthogonal vectors (2-OV). This is the first rigorous proof of the conjectured quadratic lower-bound in detecting HB races. Second, we show that the recently introduced synchronization-preserving races are hard to detect for OV-3 and thus have a cubic lower bound, when $T=\Omega(N)$. This establishes a complexity separation from HB races which are known to be less expressive. Third, we show that lock-cover races are hard for 2-OV, and thus have a quadratic lower-bound, even when $T=2$ and $L = \omega(\log N)$. The similar notion of lock-set races is known to be detectable in $O(N\cdot L)$ time, and thus we achieve a complexity separation between the two. Moreover, we show that lock-set races become hitting-set (HS)-hard when $L=\Theta(N)$, and thus also have a quadratic lower bound, when the input is sufficiently complex.
翻译:数据竞赛是变速器中最常见的错误。 数据竞赛的标准方法是动态分析, 它比执行同时程序要多得多, 而不是程序源代码。 有关这个主题的丰富文献创造了各种动态数据竞赛的概念, 当某些参数( 例如线条数量) 较小时, 就能有效地检测这些数据竞赛。 但是, 所有这些种族概念的复杂程度仍然难以找到, 使得无法在精确度和效率之间进行交易。 在这项工作中, 我们为许多流行的动态数据竞赛概念建立一些细化的分解 。 因此, 输入是一种执行跟踪, 美元、 美元、 线条和 美元。 我们的主要结果如下。 首先, 我们显示在 美元( N) ( c) 之前可以检测( min( L) 美元), 美元时间, 使得它们无法在精确度与效率之间进行交易。 当 美元( N) 和 美元( t) 的分解算值之间, 更精确的分解时间可以显示 。 当 美元( t) 当我们算时, 更精确的解算时, 我们的解算到一个硬序, 也更精确的分, 。 ( 2) 。