Extended sequential reasoning for data-race-free programs

L Effinger-Dean, HJ Boehm, D Chakrabarti… - Proceedings of the 2011 …, 2011 - dl.acm.org
L Effinger-Dean, HJ Boehm, D Chakrabarti, P Joisha
Proceedings of the 2011 ACM SIGPLAN Workshop on Memory Systems Performance …, 2011dl.acm.org
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 …
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.
ACM Digital Library