Article View: comp.lang.c++
Article #557SMR load...
From: Chris M. Thomasson
Date: Wed, 14 Oct 2026 21:55
Date: Wed, 14 Oct 2026 21:55
40 lines
2286 bytes
2286 bytes
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?
______________________
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:
<11aotod$1sm8r$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-mailShow 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: SMR load... Date: Wed, 14 Oct 2026 14:55:22 -0700 Organization: A noiseless patient Spider Lines: 40 Message-ID: <11aotod$1sm8r$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 14 Oct 2026 21:55:26 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1988891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4aHK2vGsRyatFPtZ8sEdy5yRMRfe4sZs="; posting-host="643801f06158b8bfbdcc975916b62ee0" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:N0MLUxiJtHAaqpbsW3DSmpIhGt0= sha256:1VhuBLfTodGvacUwIDT4HB0SQ2ONUhRIV+8Wj2qiZBE= sha1:XhYbVnOBcten3iPHjWz/ncUcs5E= sha256:PJOeoj0QpsA6bYgGEGYl6t+8m83/amonbUl+im7uEFE= Content-Language: en-US