Technical Reports

HPL-2012-218

Click here for full text: PDF

Position Paper: Nondeterminism is unavoidable, but data races are pure evil

Boehm, Hans-J.
HP Laboratories

HPL-2012-218

Keyword(s): nondeterminism; data races; scalability

Abstract: Modern mainstream programming languages distinguish between "atomic" (or sometimes "volatile") variables, which support concurrent access, ordinary data accesses with well-defines semantics. Concurrent accesses to an ordinary data variables, if one of those is an update, is defined as a data race. This distinctionis essential; these languages provide meaningful semantics only in the absence of data races. Code with data races not only allows inaccurate results; such code may completely and repeatably fail 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; they can results in arbitrary failures, including application crashes, hangs, and inexplicably and completely wrong answers. These specifications, combined with implementation realities, make it infeasible 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 some compiler, the presence of atomic operations in languages like C and C++ means that data races provide at best inconsequential performance advantages and, in our experience, no scalability advantages at all.

6 Pages

Additional Publication Information: To be published in RACES 2012: SPLASH Workshop on Relaxing Synchronization for Multicore and Manycore Scalability.

External Posting Date: October 6, 2012 [Fulltext]. Approved for External Publication
Internal Posting Date: October 6, 2012 [Fulltext]

Back to Index