Abstract
When either of two concurrent accesses of the same data is not in its critical section, a “race condition” occurs. Previous race-detection techniques are only applicable to parallel programs without using critical sections, or to parallel programs with critical sections implemented by mutex locks. This paper presents a race-detection algorithm, called the Protect algorithm, for parallel programs where critical sections are defined in a higher-level programming construct - “critical region”. Both the time and space complexity of the Protect algorithm is improved over ones of the previous race-detection algorithms. If the control-flow of a parallel execution on a given input is deterministic, then a single-run of any race-detection algorithm guarantees to find out all races. In the presence of nondeterministic control-flow, a single-run of any race-detection algorithm cannot find out all races. We present another algorithm, called the Alter algorithm, which either guarantees to detect any nondeterministic control-flow in a program using critical regions, or certifies that the program is control-flow deterministic, thereafter all races can be detected by the Protect algorithm.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Guang-Ien Cheng, Mingdong Feng, Charles E. Leiserson, Keith H. Randall, and Andrew F. Stark. Detecting data races in Cilk programs that use locks. In Proceedings of the Tenth Annual ACM Symposium on Parallel Algorithms and Architectures (SPAA), June 1998.
Cilk-5.1 Reference Manual. Available on the Internet from “http://theory.lcs.mit.edu/~cilk”.
Anne Dinning and Edith Schonberg. An empirical comparison of monitoring algorithms for access anomaly detection. In Proceedings of the Second ACM SIGPLAN Symposium on Principles & Practice of Parallel Programming (PPoPP), pages 1–10. ACM Press, 1990.
Anne Dinning and Edith Schonberg. Detecting access anomalies in programs with critical sections. In Proceedings of the ACM/ONR Workshop on Parallel and Distributed Debugging, pages 85–96. ACM Press, May 1991.
Mingdong Feng and Charles E. Leiserson. Eficient detection of determinacy races in Cilk programs. In Proceedings of the Ninth Annual ACM Symposium on Parallel Algorithms and Architectures (SPAA), pages 1–11, Newport, Rhode Island, June 1997.
P. Brinch Hansen. Structured multiprogramming. Communication of the ACM, 15(7):574–578, July 1972.
C. A. R. Hoare. Towards a theory of parallel programming. In C. A. Hoare and R. H. Perrott, editors, Operating Systems Techniques, pages 61–71. Academic Press, London, 1972.
John Mellor-Crummey. On-the-fly detection of data races for programs with nested fork-join parallelism. In Proceedings of Supercomputing’91, pages 24–33. IEEE Computer Society Press, 1991.
Robert H. B. Netzer and Sanhoy Ghosh. Eficient race condition detection for shared-memory programs with post/wait synchronization. In Proceedings of the 1992 International Conference on Parallel Processing, St. Charles, Illinois, August 1992.
Robert H. B. Netzer and Barton P. Miller. On the complexity of event ordering for shared-memory parallel program executions. In Proceedings of the 1990 International Conference on Parallel Processing, pages II: 93–97, August 1990.
Robert H. B. Netzer and Barton P. Miller. What are race conditions? ACM Letters on Programming Languages and Systems, 1(1):74–88, March 1992.
Itzhak Nudler and Larry Rudolph. Tools for the eficient development of eficient parallel programs. In Proceedings of the First Israeli Conference on Computer Systems Engineering, May 1986.
Dejan Perković and Peter Keleher. Online data-race detection via coherency guarantees. In Proceedings of the Second USENIX Symposium on Operating Systems Design and Implementation (OSDI), Seattle, Washington, October 1996.
Stefan Savage, Michael Burrows, Greg Nelson, Patric Sobalvarro, and Thomas Anderson. Eraser: A dynamic race detector for multi-threaded programs. In Proceedings of the Sixteenth ACM Symposium on Operating Systems Principles (SOSP), October 1997.
Guy L. Steele Jr. Making asynchronous parallelism safe for the world. In Proceedings of the Seventeenth Annual ACM Symposium on Principles of Programming Languages (POPL), pages 218–231. ACM Press, 1990.
Robert Endre Tarjan. Applications of path compression on balanced trees. Journal of the Association for Computing Machinery, 26(4):690–715, October 1979.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Feng, M., Yuen, C.K. (1998). Detection of Races and Control-Flow Nondeterminism. In: O’Hallaron, D.R. (eds) Languages, Compilers, and Run-Time Systems for Scalable Computers. LCR 1998. Lecture Notes in Computer Science, vol 1511. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-49530-4_26
Download citation
DOI: https://doi.org/10.1007/3-540-49530-4_26
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-65172-7
Online ISBN: 978-3-540-49530-7
eBook Packages: Springer Book Archive