🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Consequential RCU

#555
From: Chris M. Thomasson
Date: Wed, 14 Oct 2026 21:16
55 lines
2874 bytes
On 10/13/2026 4:34 PM, Joseph Seigh wrote:
> On 10/13/26 3:36 PM, Chris M. Thomasson wrote:
>> On 10/13/2026 10:01 AM, Joseph Seigh wrote:
> 
>>> This is what the code I did a quick and dirty test with looked like
>>>
>>> using csequence_t = uint64_t;
>>>
>>> inline bool cseq_retry(csequence_t mark, std::atomic<csequence_t> & 
>>> sequence)
>>> {
>>>      std::atomic_thread_fence(std::memory_order_acquire);
>>>      return mark != sequence.load(std::memory_order_acquire);
>>> }
>>>
>>> csequence_t mark;
>>>
>>> retry:
>>> do {
>>>
>>>      mark = cseq_count.load(std::memory_order_acquire);
>>>      node_t * item = list.load(std::memory_order_acquire);
>>>
>>>      for (int ndx2 = 0; ndx2 < depth; ndx2++) {
>>>          item = item->next.load(std::memory_order_acquire);
>>>          if (cseq_retry(mark, cseq_count)) [[unlikely]]
>>>              goto retry;
>>>      }
>>>
>>> } while (cseq_retry(mark, cseq_count));
>>>
>>>
>>> As you can see, not a heck of lot of room in that loop
>>> for the cpu pipeline to deal with the extra load and
>>> conditional logic.
[...]

Its interesting. Btw, I don't even need traditional SMR logic! This 
works fine:
________________
per_node*
smr_load(
     unsigned long tidx
) {
     per_node* node0 = m_node.load(rl::mo_relaxed, $);
     m_threads[tidx].m_haz_0.store(node0, rl::mo_relaxed, $);
     return node0;
}
________________





Technical Details
Message-ID: <11aorf3$1rrdk$2@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: <118f4vv$3plsv$1@dont-email.me> <11ag8ue$2nvjl$1@dont-email.me> <11alo51$nmur$1@dont-email.me> <11am17q$rl8q$1@dont-email.me> <11amf6v$10g9m$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: Consequential RCU
Date: Wed, 14 Oct 2026 14:16:18 -0700
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <11aorf3$1rrdk$2@dont-email.me>
References: <118f4vv$3plsv$1@dont-email.me> <11ag8ue$2nvjl$1@dont-email.me>
 <11alo51$nmur$1@dont-email.me> <11am17q$rl8q$1@dont-email.me>
 <11amf6v$10g9m$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 21:16:20 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1961396"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/AqNnPtDQcOVij+b2YYGspeMrhHAOIK8s="; posting-host="643801f06158b8bfbdcc975916b62ee0"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:+/XzOrdA5dJxLTzVB8J9D9Bdrvc= sha256:HCiNEg1GOTRh832fzEvg775E8GrpCzY6Zhdf/CW4OuA=
	sha1:0btquSAOa3eb00t5x1I3hhgPO4E= sha256:W4OK7bg3WavMUvPEou4YVit/cbFk1ajrbX9rmalnsaU=
In-Reply-To: <11amf6v$10g9m$1@dont-email.me>
Content-Language: en-US