skip to main content
10.1145/2414729.2414732acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Position paper: nondeterminism is unavoidable, but data races are pure evil

Published: 21 October 2012 Publication History

Abstract

Modern mainstream programming languages distinguish between "atomic" (or sometimes "volatile") variables, and ordinary data. Atomic accesses are treated as synchronization constructs, and support concurrent access with well-defined semantics. In contrast, concurrent accesses to ordinary data, if at least one access is an update, constitute a data race. Code with data races does not have well-defined semantics. Such code may fail completely when recompiled or run on a different operating system version. In C and C++ data races are equivalent to assignments to out-of-bounds array elements; any data race can result in arbitrary failures, including application crashes, hangs, and inexplicably and completely wrong answers.
These language specifications, combined with implementation realities, make it unsafe to exploit "benign" data races to obtain performance, even if we are willing to tolerate approximate answers. Furthermore, even if we happen to get lucky, and code with data races happens to execute correctly with our current compiler, data races provide at best inconsequential performance advantages over atomics. In fact, there are interesting, and probably common, cases in which data races provide only a minor performance advantage, even over pervasive locking to avoid them, it at sufficiently large core counts. We demonstrate such a case.

References

[1]
S. V. Adve. Data races are evil with no exceptions: technical perspective. Commun. ACM, 53(11), 2010.
[2]
S. V. Adve and H.-J. Boehm. Memory models: A case for rethinking parallel languages and hardware. Communications of the ACM, 53(8):90--101, August 2010.
[3]
T. Bergan, J. Devietti, N. Hunt, and L. Ceze. The deterministic execution hammer: How well does it actually pound nails? In The Second Workshop on Determinism and Correctness in Parallel Programming: Wodet 2, 2011.
[4]
H.-J. Boehm. Threads cannot be implemented as a library. In Proc. Conf. on Programming Language Design and Implementation, 2005.
[5]
H.-J. Boehm. How to miscompile programs with "benign" data races. In HotPar, 2011.
[6]
H.-J. Boehm. Can seqlocks get along with programming language memory models. In MSPC, 2012.
[7]
H.-J. Boehm and S. V. Adve. You don't know jack about shared variables. Communications of the ACM, 55(2), February 2012.
[8]
J. Devietti, J. Nelson, T. Bergan, L. Ceze, and D. Grossman. Rcdc: A relaxed consistency deterministic computer. In ASPLOS, 2011.
[9]
L. Effinger-Dean, H.-J. Boehm, D. Chakrabarti, and P. Joisha. Extended sequential reasoning for data-race-free programs. In MSPC, 2011.
[10]
J. Gosling, B. Joy, G. Steele, G. Bracha, and A. Buckley. The java language specification: Java se 7 edition. http://docs.oracle.com/javase/specs/jls/se7/html/index.html.
[11]
R. Grisenthwaite. Armv8 technology preview (slides). www.arm.com/files/downloads/ARMv8_Architecture.pdf, retrieved Aug. 3, 2012, 2011.
[12]
S. Hemminger. Fast reader/writer lock for gettimeofday 2.5.30. Linux kernel mailing list August 12, 2002, http://lwn.net/Articles/7388/.
[13]
IEEE and The Open Group. IEEE Standard 1003.1--2001. 2001.
[14]
ISO JTC1/SC22/WG14. ISO/IEC 9899:2011, information technology -- programming languages -- C. http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?%csnumber=57853 or an approximation at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf.
[15]
ISO JTC1/SC22/WG21. ISO/IEC 14882:2011, information technology -- programming languages -- C++. http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?%csnumber=50372 or a close approximation at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3376.pdf.
[16]
R. L. B. Jr., S. Heumann, N. Honarmand, S. V. Adve, V. S. Adve, A. Welc, and T. Shpeisman. Safe nondeterminism in a determinism-by-default parallel language. In POPL, pages 535--548, 2011.
[17]
C. Lameter. Effective synchronization on Linux/NUMA systems. Proceedings of the May 2005 Gelato Federation Meeting (http://www.lameter.com/gelato2005.pdf), 2005.
[18]
L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Transactions on Computers, C-28(9):690--691, 1979.
[19]
P. E. McKenney. Exploiting Deferred Destruction: An Analysis of Read-Copy-Update Techniques in Operating System Kernels. PhD thesis, OGI School of Engineering at Oregon Health and Science University, 2004.
[20]
S. Narayanasamy et al. Automatically classifying benign and harmful data races using replay analysis. In Proc. Conf. on Programming Language Design and Implementation, pages 22--31, 2007.
[21]
RACES Workshop organizers. SPLASH 2012 RACES workshop call for participation. http://soft.vub.ac.be/races/call-for-participation/.
[22]
J. Sevcik and D. Aspinall. On validity of program transformations in the java memory model. In ECOOP 2008, pages 27--51, 2008.
[23]
J. Sevcik and P. Sewell. C/C++11 mappings to processors. http://www.cl.cam.ac.uk/ pes20/cpp/cpp0xmappings.html, retrieved Mar. 3, 2012, 2011.
[24]
P. Sewell, S. Sarkar, S. Owens, F. Z. Nardelli, and M. O. Myreen. x86-tso: A rigorous and usable programmer's model for x86 multiprocesors. Communications of the ACM, 53(7):89--97, July 2010.
[25]
United States Department of Defense. Reference Manual for the Ada Programming Language: ANSI/MIL-STD-1815A-1983 Standard 1003.1--2001, 1983. Springer.

Cited By

View all
  • (2024)Optimistic Prediction of Synchronization-Reversal Data RacesProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639099(1-13)Online publication date: 20-May-2024
  • (2021)Safe-by-default Concurrency for Modern Programming LanguagesACM Transactions on Programming Languages and Systems10.1145/346220643:3(1-50)Online publication date: 3-Sep-2021
  • (2021)Optimal prediction of synchronization-preserving racesProceedings of the ACM on Programming Languages10.1145/34343175:POPL(1-29)Online publication date: 4-Jan-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
RACES '12: Proceedings of the 2012 ACM workshop on Relaxing synchronization for multicore and manycore scalability
October 2012
74 pages
ISBN:9781450316323
DOI:10.1145/2414729
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 October 2012

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. atomic operations
  2. data races
  3. locks
  4. scalability
  5. synchronization

Qualifiers

  • Research-article

Conference

SPLASH '12
Sponsor:

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)7
  • Downloads (Last 6 weeks)0
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Optimistic Prediction of Synchronization-Reversal Data RacesProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639099(1-13)Online publication date: 20-May-2024
  • (2021)Safe-by-default Concurrency for Modern Programming LanguagesACM Transactions on Programming Languages and Systems10.1145/346220643:3(1-50)Online publication date: 3-Sep-2021
  • (2021)Optimal prediction of synchronization-preserving racesProceedings of the ACM on Programming Languages10.1145/34343175:POPL(1-29)Online publication date: 4-Jan-2021
  • (2020)The Complexity of Dynamic Data Race PredictionProceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3373718.3394783(713-727)Online publication date: 8-Jul-2020
  • (2019)Dependence-aware, unbounded sound predictive race detectionProceedings of the ACM on Programming Languages10.1145/33606053:OOPSLA(1-30)Online publication date: 10-Oct-2019
  • (2018)High-coverage, unbounded sound predictive race detectionACM SIGPLAN Notices10.1145/3296979.319238553:4(374-389)Online publication date: 11-Jun-2018
  • (2018)High-coverage, unbounded sound predictive race detectionProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3192366.3192385(374-389)Online publication date: 11-Jun-2018
  • (2018)An academic's observations from a sabbatical at GoogleCommunications of the ACM10.1145/317774861:9(31-33)Online publication date: 22-Aug-2018
  • (2018)Software Adaptation in Wireless Sensor NetworksACM Transactions on Autonomous and Adaptive Systems10.1145/314545312:4(1-29)Online publication date: 23-Jan-2018
  • (2017)Collapsing towers of interpretersProceedings of the ACM on Programming Languages10.1145/31581402:POPL(1-33)Online publication date: 27-Dec-2017
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media