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%。