Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. In computing, a
memory model describes the interactions of threads through memory and
their shared use of the data. A memory model allows a compiler to
perform many important optimizations. Even simple compiler optimizations
like loop fusion move statements in the program can influence the order
of read and write operations of potentially shared variables. Changes in
the ordering of reads and writes can cause race conditions. Without a
memory model, a compiler is not allowed to apply such optimizations to
multi-threaded programs in general, or only in special cases.