🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #558

Re: SMR load...

#558
From: Chris M. Thomasson
Date: Wed, 14 Oct 2026 22:11
50 lines
2832 bytes
On 10/14/2026 2:55 PM, Chris M. Thomasson wrote:
> Why does the C++ memory model seem to require async SMR loads to 
> basically NEED std::memory_order_consume, which iirc gets folded into 
> acquire. on the load side of SMR?


Pure ISO C++ no longer gives you a way to express “this load only needs 
dependency ordering, no full acquire barrier.”

Sigh.


> ______________________
>   per_node*
>   smr_load(
>       unsigned long tidx
>   ) {
>       for (;;)
>       {
>           per_node* node0 = m_node.load(rl::mo_relaxed, $);
> 
>           if (! node0)
>           {
>               RL_ASSERT(0); // hould never happen in this test!
>               m_threads[tidx].m_haz_0.store(nullptr, rl::mo_relaxed, $);
>               break;
>           }
> 
>           m_threads[tidx].m_haz_0.store(node0, rl::mo_relaxed, $);
> 
>           // actually, iirc, a single seq_cst right here should work?
>           // well, this is an async test...
> 
>           per_node* node1 = m_node.load(rl::mo_consume, $);
> 
>           // uncomment below, Relacy goes berserker!
>           //per_node* node1 = m_node.load(rl::mo_relaxed, $);
>           if (node0 == node1)
>           {
>               return node0;
>           }
>       }
> 
>       return nullptr;
>   }
> ______________________
> 
> 
> If I make that mo_consume relaxed, Relacy shits its pants.
Technical Details
Message-ID: <11aoum9$1t08a$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11aotod$1sm8r$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.c++
Subject: Re: SMR load...
Date: Wed, 14 Oct 2026 15:11:20 -0700
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <11aoum9$1t08a$1@dont-email.me>
References: <11aotod$1sm8r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 14 Oct 2026 22:11:22 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1999114"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+UOD1dLeqgfy3O3Xn24+/Z8s3wfWu+pbo="; posting-host="643801f06158b8bfbdcc975916b62ee0"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:n2NJaSmD607YsXQ3dRhHd5mumHs= sha256:wdkCJexovCe/NpB3/gKlmaNVYaADbIYa4UUDj3lVjiI=
	sha1:wUj7BOKcKgGXPtphKD1qFtMUB3c= sha256:9YKqALtXj/eazkEWC3AMJ4NIlfogWfqVxznLP5UyGzE=
In-Reply-To: <11aotod$1sm8r$1@dont-email.me>
Content-Language: en-US