Relaxed Memory Model Zoo

Volatile-by-Default (VbD)
← Back to the map

Volatile-by-Default VbD

2017 · Liu, Millstein, Musuvathi · language, formal

A volatile-by-default semantics for Java in which every memory access is treated as volatile (sequentially consistent) by default. Bare VbD carries a considerable penalty (28% average / 81% maximum on x86; 57% / 157% on Armv8), so the authors add a just-in-time technique that speculatively treats each object as thread-local and compiles its accesses without fences, recompiling to insert fences once concurrent access is detected — bringing the Armv8 overhead down to 37% average / 73% maximum. It admits exactly the SC behaviours.

Properties

Property vector survey-sourced — from Tables 1–2 of the Moiseenko et al. survey, except cells that cite a specific source.

Compilation optimal mapping to
  • no x86
  • no POWER
  • no Armv7
  • no Armv8
Reordering sound
  • no Store→Load
  • no Store→Store
  • no Load→Load
  • no Load→Store
Elimination sound
  • yes Store/Load
  • yes Store/Store
  • yes Load/Load
  • yes Load/Store
Other local transformations
  • yes Irrelevant load elim.
  • yes Speculative load intro.
  • yes Roach motel
  • yes Inverse roach motel Poetzl & Kroening 2015
  • yes Strengthening
  • yes Trace preserving
  • no Common subexpr. elim.
Global transformations
  • yes Register promotion
  • yes Thread inlining
Reasoning guarantees
  • yes External DRF
  • yes Coherence
  • yes No undefined behaviour
  • yes In-order execution
  • yes No out-of-thin-air

Ordering relationships

Equivalent to
  • Sequential Consistency (SC) — Volatile-by-default makes every Java access sequentially consistent, so it admits exactly the SC outcomes; it differs from SC only in enforcement mechanism (speculative JIT recompilation) and performance.

References

  • Lun Liu, Todd Millstein, Madanlal Musuvathi. A Volatile-by-Default JVM for Server Applications. OOPSLA 2017 (PACMPL vol. 1), 2017. doi:10.1145/3133873
  • Lun Liu, Todd Millstein, Madanlal Musuvathi. Accelerating Sequential Consistency for Java with Speculative Compilation. PLDI 2019, 2019. doi:10.1145/3314221.3314611
  • Evgenii Moiseenko, Anton Podkopaev, Dmitrii Koznov. A Survey of Programming Language Memory Models. Programming and Computer Software 47(6), pp. 439–456, 2021. doi:10.1134/S0361768821060050
  • Daniel Poetzl, Daniel Kroening. Formalizing and Checking Thread Refinement for Data-Race-Free Execution Models. arXiv:1510.07171, 2015. arxiv.org/abs/1510.07171