Detecting race conditions in parallel programs that use one semaphore

  • Hsueh -I Lu
  • Philip N. Klein
  • Robert H. B. Netzer
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 709)


We address a problem arising in debugging parallel programs, detecting race conditions in programs using a single semaphore for synchronization. It is NP-complete to detect races in programs that use many semaphores. For the case of a single semaphore, we give an algorithm that takes O(n1.5p) time, where p is the number of processors and n is the total number of semaphore operations executed. Our algorithm constructs a representation from which one can determine in constant time whether a race exists between two given events.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Abdel-Wahab, H. M., “Scheduling with Application to Register Allocation and Deadlock Problems,” University of Waterloo, PhD Thesis, 1976.Google Scholar
  2. [2]
    Abdel-Wahab, H. M. & Kameda, T., “Scheduling to Minimize Maximum Cumulative Cost Subject to Series-parallel Precedence Constraints,” Operations Research 26 (1978), 141–158.Google Scholar
  3. [3]
    -, “On Strictly Optimal Schedules for the Cumulative Cost-Optimal Scheduling Problem,” Computing 24 (1980), 61–86.Google Scholar
  4. [4]
    Emrath, P. A., Ghosh, S. & Padua, D. A., “Event Synchronization Analysis for Debugging Parallel Programs,” Supercomputing '89 (November 1989), 580–588.Google Scholar
  5. [5]
    Garey, M. R. & Johnson, D. S., Computers and Intractability—A Guide to the Theory of NP-Completeness, W. H. Freeman and Company, 1979.Google Scholar
  6. [6]
    Helmbold, D. P. & McDowell, C. E., “A Class of Synchronization Operations that Permit Efficient Race Detection,” University of California at Santa Cruz Technical Report (January 1993).Google Scholar
  7. [7]
    Helmbold, D. P., McDowell, C. E. & Wang, J-Z., “Analyzing Traces with Anonymous Synchronization,” International Conference on Parallel Processing (August 1990), II70–II77.Google Scholar
  8. [8]
    Netzer, R. H. B. & Ghosh, S., “Efficient Race Condition Detection for Shared-Memory Programs with Post/Wait Synchronization,” International Conference on Parallel Processing (August 1992), II242–II246.Google Scholar
  9. [9]
    Netzer, R. H. B. & Miller, B. P., “On the Complexity of Event Ordering for Shared-Memory Parallel Program Executions,” International Conference on Parallel Processing (August 1990), II93–II97.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1993

Authors and Affiliations

  • Hsueh -I Lu
    • 1
  • Philip N. Klein
    • 1
  • Robert H. B. Netzer
    • 1
  1. 1.Department of Computer ScienceBrown UniversityProvidenceUSA

Personalised recommendations