Article View: comp.lang.c++
Article #5Re: Consequential RCU
From: Chris M. Thomasson
Date: Wed, 07 Oct 2026 04:31
Date: Wed, 07 Oct 2026 04:31
31 lines
2865 bytes
2865 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: [...] Fwiw, I posted my older proxy collector that can gain RCU like performance wrt amortized use in user space. It does not use CAS, just fetch_add.
Technical Details
Message-ID:
<11a4hv8$2i092$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> <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:31:35 -0700 Organization: A noiseless patient Spider Lines: 31 Message-ID: <11a4hv8$2i092$2@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: Wed, 07 Oct 2026 04:31:37 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2687266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yOfj/KvB+LLpDBdA4M8diQyFFu2IQWOE="; posting-host="9e5dad94c1931ab85b8ca42122ca3b99" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:jRhSBgeP1h7Kw5oQCSFR9DQ92IU= sha256:YiqeujzXQ8ycNJreKOh7OMYtvNhcJpmxHC/xBoCsR4A= sha1:CR7TioDovzY6Hn/CWoa5gEG2o14= sha256:yWAyHsSHEqc/R8Mxd1x+BkBGSv1gFRqRlKqC7o2dtDI= Content-Language: en-US In-Reply-To: <11a0tf5$18frd$1@raubtier-asyl.eternal-september.org>