Article View: comp.lang.c++
Article #572Re: Consequential RCU
From: Chris M. Thomasson
Date: Thu, 15 Oct 2026 18:26
Date: Thu, 15 Oct 2026 18:26
56 lines
3463 bytes
3463 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.
>>>
>>
>> It seems like cseq_retry on "every" iteration with its, two?,
>> #LoadStore | #LoadLoad barriers is a bit much. Now that I have Relacy
>> working fine on my end, and it has all I need for simulating even
>> advanced RCU+SMR algos. Well, I will get back into it from time to
>> time. Actually, can you get it working? Its a neat way to simulate
>> your sync experiments.
>>
>> Wait I count an acquire on the item->next.load and then two acquires
>> from cseq_retry? Am I missing something critical here Joe?
>
> It would appear that way. That's what quick and dirty means. :)
> If the redundant load/load gets take out then there needs to be
> some other mechanism or documentation to ensure the loads are in
> order.
Also, cseq_retry on x86/x64 should be native to their TSO anyway? So, no
ops? But on a SPARC in RMO mode. The damn MEMBAR #LoadStore | #LoadLoad
would kick in?
Technical Details
Message-ID:
<11ar5s4$2lg07$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-mailReferences:
<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: Thu, 15 Oct 2026 11:26:11 -0700 Organization: A noiseless patient Spider Lines: 56 Message-ID: <11ar5s4$2lg07$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: Thu, 15 Oct 2026 18:26:13 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2801671"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HgwSDUGHlgYpss22yOuyO+sH6GPMzMq8="; posting-host="979f69778276c51b653f13045ccea5e5" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:gzxHuVx9/5o8CodEEkXNA2sYiIg= sha256:Knf2CZWF7JfWl5Beqnu/Un/Sc+bKYW/G6oUp50ub6H0= sha1:EDgebSpayB34UD/kZFgeqfHF0RY= sha256:6SVKuaXUDuz6wq/fEcQzWBfLelDSFskO9/YjS5iNZr8= Content-Language: en-US In-Reply-To: <11amf6v$10g9m$1@dont-email.me>