On 02/27/2018 05:40 PM, Simon Wright wrote:
Sorry to butt in, but - if it's ROM why would you need atomic load anyway? (of course, if it's just a constant view of the object, reason is obvious)
On many systems, the read-only nature of a memory region is a thread-local or process-local attribute. Other parts of the system might have a different view on the same memory region.
Some CPUs support memory protection keys, which provide a cheap way to switch memory from read-only to read-write and back, and those switching operations deliberately do not involve a memory barrier.
Thanks, Florian