Article View: comp.lang.c++
Article #6Re: Consequential RCU
From: Chris M. Thomasson
Date: Wed, 07 Oct 2026 04:33
Date: Wed, 07 Oct 2026 04:33
27 lines
3002 bytes
3002 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: Bench mark it against Joes atomic ptr that uses DWCAS. Keep in mind that we can use it to make a proxy collector that has RCU like performance as well. Keep in mind that it involves a thread being able to take a reference to something it does no already own. No locks. Once a local_ptr is gained its basically equal to basic thread saftey normal atomic refcount.
Technical Details
Message-ID:
<11a4i3l$2i092$3@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> <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: Tue, 6 Oct 2026 21:33:57 -0700 Organization: A noiseless patient Spider Lines: 27 Message-ID: <11a4i3l$2i092$3@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: 7bit Injection-Date: Wed, 07 Oct 2026 04:33:58 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2687266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19R8FT0D0tU7kGTyw6zmc8j0vieh/LdIUA="; posting-host="9e5dad94c1931ab85b8ca42122ca3b99" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:ZnFieU2eKijozGWwHLZ6PVPevdA= sha256:fq8fIRgzkpB4MzuUeKtphvWQ8gmaD+2gydQ3cVCvT88= sha1:IewEeRljx7w3ztciFXJvzRHGuUE= sha256:FMr3SWCT9rjhi1KzUyL1nzIuWtXE7EWFoPvRZv7UTqo= Content-Language: en-US In-Reply-To: <11a0tf5$18frd$1@raubtier-asyl.eternal-september.org>