Sujet : Re: Memory ordering
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.archDate : 20. Dec 2024, 01:58:19
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vk2ffb$33q08$2@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 22 23
User-Agent : Mozilla Thunderbird
On 12/19/2024 4:48 PM, Chris M. Thomasson wrote:
On 12/19/2024 3:59 PM, MitchAlsup1 wrote:
On Thu, 19 Dec 2024 21:19:24 +0000, Chris M. Thomasson wrote:
[...]
std::atomic<unsigned long> m_state = 0;
m_state.store(std::memory_order_release);
^^^^^^^^^^^^^^
I need to use the API correctly... Sorry for that mistake.
m_state.store(1, std::memory_order_release);
I needed to actually store a damn value to m_state.
Does not require an explicit barrier on the x86. LOCK, MFENCE, ect...