Programming Language Memory Models (Memory Models, Part 2)
Programming Language Memory Models
Posted on Tuesday, July 6, 2021.
PDF
Programming language memory models answer the question
of what behaviors parallel programs can rely on
to share memory between their threads.
For example, consider this program in a C-like language,
where both x and done start out zeroed.
// Thread 1 // Thread 2
x = 1; while(done == 0) { /* loop */ }
done = 1; print(x);
The program attempts to send a message in x from thread 1 to thread 2...
Read more at research.swtch.com