Towards Understanding the Costs of Avoiding Out-of-Thin-Air Results
Wed 7 Nov 2018 18:24 - 18:26 at Georgian - Poster & SRC
So-called “out-of-thin-air” (OOTA) results are an open problem with many existing programming language memory models including Java, C, and C++. OOTA behaviors are problematic in that they break both formal and informal modular reasoning about program behavior. Defining memory model semantics that are easily understood, allow existing optimizations, and that forbid OOTA results remains an open problem. This paper explores two simple solutions to this problem that forbid OOTA results by restricting compiler optimizations. One solution is targeted towards C/C++-like memory models in which racing operations are explicitly labeled as atomic operations and a second solution is targeted towards Java-like languages in which all memory operations may create OOTA executions. Our solutions provide a per-candidate execution criteria that makes it possible to examine a single execution and determine whether the memory model permits the execution. We implement and evaluated both solutions in the LLVM compiler framework. Our results suggest that OOTA behaviors can be eliminated from language memory models with minimal runtime overhead.