🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Consequential RCU

#55
From: Chris M. Thomasson
Date: Fri, 09 Oct 2026 01:53
27 lines
2759 bytes
On 10/5/2026 12:23 PM, Bonita Montero wrote:
> Am 05.10.2026 um 19:57 schrieb Chris M. Thomasson:
> 
>> Not sure what you mean. Traditional RCU reads do not need any atomic 
>> RMW's and/or memory barriers (alpha aside for a moment).
> 
> My idea is that a thread periodically polls for updates on shared data.
> Between these updates the data may become stale. The thread-local poin-
> ter is inside a shared_obj<T>. The central threaded analogy for an
> atomic<shared_ptr<T>> is my tshared_obj<T>.
> As long as the shared tshared_obj<T> doesn't change the updates are
> nearly for free. If the object changes the access is locked, but not
> with a separate futex; the pointer itself is the futex, meaning that
> it goes to -1 while there's a deferred update of the reference coun-
> ter the object points to. The pointer changes back to its initial
> value once the change has completed.
> The following diagram shows the micro-benchmark erformance of updating
> a shared_obj<T> periodically from a tshred_obj<T>, which itself doesn't
> change. The scaling is logarithmic. As you see the update is nearly for
> free. The atomic shared_ptr's update is up to more than 10.000 times
> slower:
> 
>      https://ibb.co/nqGHv9pL
> 
> This is the complete source:[...]

Are you sure that cannot ever accidentally leak?
Technical Details
Message-ID: <11a9hfk$cm5t$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: <118f4vv$3plsv$1@dont-email.me> <11a0l38$150m3$1@raubtier-asyl.eternal-september.org> <11a0odn$16c2e$1@dont-email.me> <11a0tf5$18frd$1@raubtier-asyl.eternal-september.org>

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, 8 Oct 2026 18:53:52 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <11a9hfk$cm5t$1@dont-email.me>
References: <118f4vv$3plsv$1@dont-email.me>
 <11a0l38$150m3$1@raubtier-asyl.eternal-september.org>
 <11a0odn$16c2e$1@dont-email.me>
 <11a0tf5$18frd$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 09 Oct 2026 01:53:57 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="415933"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19wtvIPBTy8Kr7gtbMEBnmfS2i8khb/scI="; posting-host="61576c8cd7392d5224927fcaadf1a471"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:wKZWUaR4bkmOtb06NvaX4JEmdFw= sha256:M0N65BZS2be0VNw656gAYIb396PJcasNvOIA5drwNFw=
	sha1:VlMrRtwdkx4hN2ROmTLREWWiZYE= sha256:LzEwpP+TwV70ISztVez4BDshFrVXlpOPW92feKnWXfc=
Content-Language: en-US
In-Reply-To: <11a0tf5$18frd$1@raubtier-asyl.eternal-september.org>