The lock set method and the partial order method are two main approaches to guarantee that dynamic data race prediction remains efficient. There are many variations of these ideas. Common to all of them is the assumption that the events in a critical section belong to the same thread. We have evidence that critical sections in the wild do extend across thread boundaries even if the surrounding acquire and release events occur in the same thread. We introduce the novel concept of a cross-thread critical section to capture such situations, offer a theoretical comprehensive framework, and study their impact on state-of-the-art data race analyses. For sound partial order relations such as WCP, SDP, and DCtp, the occurrence of cross-thread critical sections negatively impacts their precision. For complete partial order relations such as WDP and PWR, cross-thread critical sections help to eliminate more false positives. The same (positive) impact applies to the lock set construction. Our experimental evaluation confirms that cross-thread critical sections arise in practice. For the complete relation PWR, we are able to reduce the number of false positives. The performance overhead incurred by tracking cross-thread critical sections slows down the analysis by 10\%-20\%, on average.
翻译:锁集方法和偏序方法是保证动态数据竞态预测仍然高效的两种主要方法。这些方法存在多种变体。它们的共同点是假设临界区中的事件属于同一线程。我们有证据表明,实际环境中的临界区确实会跨越线程边界,即使周围的加锁和解锁事件发生在同一线程中。我们引入了跨线程临界区这一新颖概念来捕捉此类情况,提供了一个全面的理论框架,并研究了它们对最新数据竞态分析的影响。对于WCP、SDP和DCtp等可靠的偏序关系,跨线程临界区的出现会对其精度产生负面影响。对于WDP和PWR等完备的偏序关系,跨线程临界区有助于消除更多误报。同样的(正面)影响也适用于锁集构造。我们的实验评估证实了跨线程临界区在实际中确实存在。对于完备关系PWR,我们能够减少误报数量。追踪跨线程临界区所带来的性能开销使分析速度平均减慢10%-20%。