Article View: comp.lang.c++
Article #7Re: Consequential RCU
From: Chris M. Thomasson
Date: Wed, 07 Oct 2026 04:34
Date: Wed, 07 Oct 2026 04:34
30 lines
3125 bytes
3125 bytes
On 10/6/2026 9:33 PM, Chris M. Thomasson wrote: > 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. No locks, no futex, etc...
Technical Details
Message-ID:
<11a4i5a$2i092$4@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> <11a4i3l$2i092$3@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: Tue, 6 Oct 2026 21:34:49 -0700 Organization: A noiseless patient Spider Lines: 30 Message-ID: <11a4i5a$2i092$4@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> <11a4i3l$2i092$3@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 07 Oct 2026 04:34:50 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2687266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Om8bIzwos6VJ1SdObMqWQ+SCtMzB46Bc="; posting-host="9e5dad94c1931ab85b8ca42122ca3b99" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:gUmrXtpiazX2MXPnHNwdZ3/5cgo= sha256:j7+gDliT6tR0SUg3AgKP6GSS+k4GzD0DAbPRXaW5Guo= sha1:6b6Y3PqVTZIRTn/jZoA+p6fvgGk= sha256:CD976jQzzt5GKMmmpm0ZdvpbaLaCL1iWF9Gai8d57DM= Content-Language: en-US In-Reply-To: <11a4i3l$2i092$3@dont-email.me>