Article View: comp.lang.c++
Article #1088Re: Consequential RCU Performance
From: Ross Finlayson
Date: Tue, 01 Dec 2026 23:43
Date: Tue, 01 Dec 2026 23:43
124 lines
7367 bytes
7367 bytes
On 12/01/2026 12:21 PM, Chris M. Thomasson wrote: > On 12/1/2026 12:49 AM, Ross Finlayson wrote: >> On 11/30/2026 09:15 PM, Chris M. Thomasson wrote: >>> On 11/30/2026 9:02 PM, Bonita Montero wrote: >>>> Am 30.11.2026 um 23:21 schrieb Chris M. Thomasson: >>>> >>>>> Why do you refuse to use your idea for a common RCU pattern? >>>>> Just code it up! ... >>>> >>>> You are truly the embodiment of insecurity—feeling the need to apply >>>> your rigid patterns of thought to situations you don’t understand. >>> >>> God! You are the one that says RCU is not needed. But you outright >>> refuse to show how your work can be used in its place for one of RCU's >>> major and most common usage pattern. Go figure? >> >> Modern chips these days the many-core are simply as a >> distributed-system, in the horizontally scale-able best one can hope in >> the "generally independent" is compare-and-swap a.k.a. >> load-linked/store-conditional, one smallest/atomic piece of memory, >> opportunistically "locked". > > A simple example, one of many... Take a single producer/single consumer > (SPSC) queue. Show me where it needs any atomic RMW's? Guess what, it > does not. However, it does need proper memory visibility! In C/C++ > terms, memory_order... > > >> Of course there are many accounts of hardware synchronization, >> or, there are a few, various among architectures, of which >> there aren't that many. >> >> Of course synchronization more generally in the co-operative >> is for protocols, those introducing dependency / not-independency, >> then that eventually there's for leader-election or straw-pulling, >> and wider synchronization-points: for the otherwise independent >> and the least inter-dependency: there's only one reliable common >> idiom, and it's highly contended. > > It sounds as if you don't have a heck of a lot of experience with such > things? > Distributed systems as horizontally-independent (and many/multiple) thus horizontally-scale-able with eventual consistency and the critically transactional bottleneck and about opportunistic locking? Yeah, a lot. About SPSC, I don't see that needing synchronization at all, with the producer producing one at a time and consumer consuming one at a time. As a doubly-linked list inside, for example, vis-a-vis modern accounts like just using ring-buffers, equivalently, and chasing the pointers either up-and-down or around-and-round, then about whether the consumer is to block when the queue's empty, I suppose that's for semaphores usually or monitors, i.e., that the producer produces whenever it wants then if the queue is "full" it must block (or fail), the consumer consumes whenever it can then if the queue is "empty" it must block (and usually not fail), like I mentioned the other day when the operating system supports that each of the producer and consumer would be different threads and for example processes when light-weight-processes are pthreads, then about whether C++'s account of semaphore makes for blocking _according to the operating system scheduler_, that otherwise it just has that producer pushes links/datums onto the head (or tail, respectively, either way) and consumer pops links from the other end, if non-null, that according to visibilityL the consumer if it's blocking when the queue is empty should poll once at a minimal sort of interval, since it could only be waiting for memory coherency, then take to sleep if it's empty twice (that the producer producing to an empty queue has the responsibility to wake the semaphore). So, that's not so much "synchronization" as "sending a message". About the mentioned talk, for example, I went and found some modern reference or that O. Shilon bit, and had them make the point about that memory_order is orders of magnitude slower than compare-exchange, and that it's what's reliable and performant on modern architectures, he seemed to have enough experience to make sense to me. "Semaphore", "countdown latch", "latch", ..., so, I guess that's "synchronization". Then, there might as well be latches on the "empty" and "full" besides "head" and "tail". About multiple consumers, again "one item at a time", about the difference between "one item at a time" and "batch" or "sequence" which would suggest the consumer forming the input batch in their own memory in the otherwise internal representation, or getting vended a holder to copy it into, otherwise that consumers can peek the tail and then about that the queue issues it a serial number, then do the RMW(F) in which case to enter the busy loop until empty. It seems "SPSC" and so on, or as with regards to the common definitions of the "queue" usually of items, that when it's a "train", say, with multiple items that aren't to be interleaved, multiple items instead of single items, that's there's "SPSC SI", "SPSC MI", "MCMP SI", "MCSP MI", .... "Just use Kafka", sure, why not, though, you know, there are error cases on the MI, about drops/dupes, and for example these are given as "acceptable" errors yet that's not really a word. Anyways the above comment about the "unique:same" and "unique:different" always together is considered profound. Warm regards
Technical Details
Message-ID:
<WcKcnbILXd0_xpL2nZ2dnZfqnPidnZ2d@giganews.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mailReferences:
<11eceq2$1rdof$1@dont-email.me> <11ecgl8$1s72j$1@raubtier-asyl.eternal-september.org> <11ecr1d$20dln$1@dont-email.me> <11edms2$294iu$1@raubtier-asyl.eternal-september.org> <11efdu7$2ten0$1@dont-email.me> <11ege8t$387ms$2@raubtier-asyl.eternal-september.org> <11egnpf$3arfr$1@dont-email.me> <11ego7t$3avtm$1@raubtier-asyl.eternal-september.org> <11egois$3b3gl$1@dont-email.me> <11egp0r$3b7kn$1@raubtier-asyl.eternal-september.org> <11ei4on$3s8av$1@dont-email.me> <11ejbos$8745$1@raubtier-asyl.eternal-september.org> <11ekstl$u9is$1@dont-email.me> <11elkcq$18jfh$1@raubtier-asyl.eternal-september.org> <11ell66$18vsa$1@dont-email.me> <FcCdnYIMMbrLF5P2nZ2dnZfqn_adnZ2d@giganews.com> <11ena8d$2512n$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 01 Dec 2026 23:43:29 +0000 Subject: Re: Consequential RCU Performance Newsgroups: comp.lang.c++ References: <11eceq2$1rdof$1@dont-email.me> <11ecgl8$1s72j$1@raubtier-asyl.eternal-september.org> <11ecr1d$20dln$1@dont-email.me> <11edms2$294iu$1@raubtier-asyl.eternal-september.org> <11efdu7$2ten0$1@dont-email.me> <11ege8t$387ms$2@raubtier-asyl.eternal-september.org> <11egnpf$3arfr$1@dont-email.me> <11ego7t$3avtm$1@raubtier-asyl.eternal-september.org> <11egois$3b3gl$1@dont-email.me> <11egp0r$3b7kn$1@raubtier-asyl.eternal-september.org> <11ei4on$3s8av$1@dont-email.me> <11ejbos$8745$1@raubtier-asyl.eternal-september.org> <11ekstl$u9is$1@dont-email.me> <11elkcq$18jfh$1@raubtier-asyl.eternal-september.org> <11ell66$18vsa$1@dont-email.me> <FcCdnYIMMbrLF5P2nZ2dnZfqn_adnZ2d@giganews.com> <11ena8d$2512n$1@dont-email.me> From: Ross Finlayson <ross.a.finlayson@gmail.com> Date: Tue, 1 Dec 2026 15:43:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <11ena8d$2512n$1@dont-email.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <WcKcnbILXd0_xpL2nZ2dnZfqnPidnZ2d@giganews.com> Lines: 124 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-mC70iV/0rCyxKClQosmH8f+ZqPH5jHZPxP9gcRTl5R3cwJkJwq7y0ke9Dtah612pVfLJmyo4r+KXV9b!mk3xBuWZSwfFw0fcxD4Xv6vsU82MipkWcRzBKO52/WcPACbkbgzVl6UiY9yoPVmVEBBPRWf1UU4M X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40