[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #50270] Article "Problems with reordering code" misleading
From: |
Marcin Godlewski |
Subject: |
[bug #50270] Article "Problems with reordering code" misleading |
Date: |
Mon, 16 Dec 2019 15:18:02 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0 |
Follow-up Comment #10, bug #50270 (project avr-libc):
Well, as already proposed 3 years ago, the below sentences:
memory barriers ensure proper ordering of volatile accesses
memory barriers don't ensure statements with no volatile accesses to be
reordered across the barrier
may be replaced with:
memory barriers ensure proper ordering of global variables accesses
memory barriers don't ensure local variables accesses to be reordered across
the barrier
or if the word "global" and "local" are not accurate, maybe this way:
memory barriers ensure proper ordering of global variables accesses
(as every global variable is possibly a subject of sharing across different
execution contexts)
memory barriers don't ensure automatic variables accesses to be reordered
across the barrier
(as by definition, automatic variables cannot be shared across different
execution contexts)
I would also propose to add a note, that applying a memory barrier is a way of
ordering memory accesses and not a way of ordering general code execution.
Please treat this as a starting point of the discussion. Hopefully we can
achieve an agreement on new wording. The article conclusion is at least
strongly misleading and really requires an update.
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?50270>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/