Article View: comp.lang.c++
Article #535Re: Consequential RCU
From: Joseph Seigh
Date: Tue, 13 Oct 2026 23:34
Date: Tue, 13 Oct 2026 23:34
51 lines
3131 bytes
3131 bytes
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.
Technical Details
Message-ID:
<11amf6v$10g9m$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-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>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: Joseph Seigh <jseigh_es00@xemaps.com> Newsgroups: comp.lang.c++ Subject: Re: Consequential RCU Date: Tue, 13 Oct 2026 19:34:55 -0400 Organization: A noiseless patient Spider Lines: 51 Message-ID: <11amf6v$10g9m$1@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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 13 Oct 2026 23:34:56 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1065270"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//0GsdXLjbXZxz8I6uU6sN"; posting-host="4e618709ff48547e03802233e0cd58cb" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:a4lngPkAms0LELXR7ZXNztnhxIw= sha256:iuyhdu7gFZbKyBVwfO7HJ9lhbW4r35zuaUuoqt/bZ/Y= sha1:XsGhxL1yslzZAM76sXwwyXPzUaI= sha256:3kC9XxzL4qw1QuXaSWSgam8bbUylpoSeBAAYOC9PhMM= Content-Language: en-US In-Reply-To: <11am17q$rl8q$1@dont-email.me>