Technical Reports

HPL-2011-57

Click here for full text: PDF

Extended Sequential Reasoning for Data-Race-Free Programs

Effinger-Dean, Laura; Boehm, Hans-J.; Chakrabarti, Dhruva; Joisha, Pramod
HP Laboratories

HPL-2011-57

Keyword(s): program analysis, optimization, threads, data races

Abstract: Most multithreaded programming languages prohibit or discourage data races. By avoiding data races, we are guaranteed that variables accessed within a synchronization-free code region cannot be modified by other threads, allowing us to reason about such code regions as though they were single-threaded. However, such single-threaded reasoning is not limited to synchronization-free regions. We present a simple characterization of extended interference-free regions in which variables cannot be modified by other threads. This characterization shows that, in the absence of data races, important code analysis problems often have surprisingly easy answers. For instance, we can use local analysis to determine when lock and unlock calls refer to the same mutex. Our characterization can be derived from prior work on safe compiler transformations, but it can also be simply derived from first principles, and justified in a very broad context. In addition, systematic reasoning about overlapping interference-free regions yields insight about optimization opportunities that were not previously apparent. We give preliminary results for a prototype implementation of interference-free regions in the LLVM compiler infrastructure. We also discuss other potential applications for interference-free regions.

9 Pages

External Posting Date: May 6, 2011 [Fulltext]. Approved for External Publication
Internal Posting Date: May 6, 2011 [Fulltext]

Back to Index