Detecting Race Conditions in Parallel Programs that Use Semaphores
Philip N. Klein, Hsueh-I Lu, and Rob H.B. Netzer

TL;DR
This paper investigates the computational complexity of detecting race conditions in semaphore-based parallel programs, proving NP-completeness for two semaphores and providing efficient algorithms for the single semaphore case.
Contribution
It establishes NP-completeness for race detection with two semaphores and introduces two efficient algorithms for race detection when only one semaphore is used.
Findings
NP-complete to detect race conditions with two semaphores
O(n) algorithm for race detection between two operations
O(np log n) algorithm providing a compact race detection representation
Abstract
We address the problem of detecting race conditions in programs that use semaphores for synchronization. Netzer and Miller showed that it is NP-complete to detect race conditions in programs that use many semaphores. We show in this paper that it remains NP-complete even if only two semaphores are used in the parallel programs. For the tractable case, i.e., using only one semaphore, we give two algorithms for detecting race conditions from the trace of executing a parallel program on p processors, where n semaphore operations are executed. The first algorithm determines in O(n) time whether a race condition exists between any two given operations. The second algorithm runs in O(np log n) time and outputs a compact representation from which one can determine in O(1) time whether a race condition exists between any two given operations. The second algorithm is near-optimal in that the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
