Extended sequential reasoning for data-race-free programs

  • Authors:
  • Laura Effinger-Dean;Hans-J. Boehm;Dhruva Chakrabarti;Pramod Joisha

  • Affiliations:
  • University of Washington;Hewlett-Packard Laboratories;Hewlett-Packard Laboratories;Hewlett-Packard Laboratories

  • Venue:
  • Proceedings of the 2011 ACM SIGPLAN Workshop on Memory Systems Performance and Correctness
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

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.