Due to compiler and hardware optimizations, modern programming languages (PLs) do not provide a sequentially consistent memory model (SC, [Lamport:TC79]), which guarantees that all concurrent behaviors of a program could be explained as a sequential execution of some interleaving of program's threads. Instead, they have weak memory models that allow more behaviors.
Such memory models have to balance between performance and guarantees provided to software developers, or, as one may say, the balance is actually between performance and sanity. That is, performance forces a memory model to allow more optimizations and, therefore, more program behaviors, whereas sanity forces a memory model to provide guarantees like /data-race-freedom/ (DRF) that a program without races has only sequentially consistent executions which restrict the set of allowed executions.
- folks interested in low-level concurrency mechanics;
- language and VM developers.
Audience takeaway: 1) Memory models of mainstream languages (C/C++ and Java) have major issues. 2) There are solutions for making different compromises. 3) There are guidelines for choosing or modifying a memory model for your language or VM.