2 ms·
In this context the Memory Model tells us about how memory seems to work in our concurrent program. It only matters if your program has concurrency (more than
by tialaramex 5y ago
In this context the Memory Model tells us about how memory seems to work in our concurrent program.
It only matters if your program has concurrency (more than one apparently simultaneous execution context, today often because there is physically more than one CPU core) and the concurrent elements of the program are able to read or write the same memory. Notice that at the speeds CPUs run, the actual main "memory" of the computer may take a relatively long time to read from or write to and so we use multiple layers of caches further complicating the problem.
We want: A model that's fast yet also a model that's understandable for merely human programmers. This turns out to be a difficult problem.