Sujet : Re: Memory ordering
De : jseigh_es00 (at) *nospam* xemaps.com (jseigh)
Groupes : comp.archDate : 17. Dec 2024, 13:33:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vjrr3m$1nppo$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Mozilla Thunderbird
On 12/16/24 16:48, Chris M. Thomasson wrote:
On 12/5/2024 5:00 AM, jseigh wrote:
>
Maybe. For thread local non-shared data if the compiler can make that
determination but I don't know if the actual specs say that.
It would be strange to me if the compiler executed a weaker barrier than what I said needed to be there. If I say I need a #LoadStore | #StoreStore here, then the compiler better put that barrier in there. Humm...
C++ concurrency was designed by a committee. They try to fit things
into their world view even if reality is a bit more nuanced or complex
than that world view.
C++ doesn't use #LoadStore, etc... memory ordering terminology. They
use acquire, release, cst, relaxed, ... While in some cases it's
straightforward as to what that means, in others it's less obvious.
Non-obvious isn't exactly what you want when writing multi-threaded
code. There's enough subtlety as it is.
Joe Seigh