Re: MemoryFence()


Ard Biesheuvel <ardb@...>
 

On Tue, 9 Feb 2021 at 15:27, Laszlo Ersek <lersek@...> wrote:

On 02/09/21 14:00, Paolo Bonzini wrote:

annotating code rather than data
(

Slightly off-topic, but I wonder why this approach (code annotations)
has proved more effective / successful, with atomics, than annotating
data. Usually it's recommended to put emphasis on data structure design
(with invariants etc), and then the code "writes itself". (I feel like
there's a famous quote to insert here, but I can't remember it.)

So I'm not questioning that annotating code is superior in this case, I
just wonder why it diverges from the usual guideline.

)
I'd say it is because we are reasoning about how accesses to the data
are ordered, not about the data itself.

Join {rfc@edk2.groups.io to automatically receive all group messages.