Relaxed Memory Model Zoo

Memory model
← Back to the map

JavaScript Memory Model JSMM

2020 · Watt, Pulte, Podkopaev, Barbier, Dolan, Flur, Pichon-Pharabod, Guo · language, formal, standard

The memory model of JavaScript, based on the C11 model. Like C11 it suffers from the thin-air problem and so provides only the internal DRF guarantee, but — unlike C11 — it does not treat racy non-atomic accesses as undefined behaviour. Because its main shared primitive is the SharedArrayBuffer, a linear mutable byte buffer, the model naturally supports mixed-size accesses. It was repaired and mechanised by Watt et al.

Ordering relationships

Incomparable with
  • C11/C++11 Memory Model — The JavaScript model is based on C11 and shares its thin-air problem (only internal DRF), but — unlike C11 — it does not treat racy non-atomic accesses as undefined behaviour and it natively supports mixed-size accesses over SharedArrayBuffer. Neither contains the other.

References

  • Conrad Watt, Christopher Pulte, Anton Podkopaev, Guillaume Barbier, Stephen Dolan, Shaked Flur, Jean Pichon-Pharabod, Shu-yu Guo. Repairing and Mechanising the JavaScript Relaxed Memory Model. PLDI 2020, 2020. doi:10.1145/3385412.3385973
  • 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