Subj : Re: full-blown experiential smr-based reference counted pointer impl... To : comp.programming.threads From : Joe Seigh Date : Fri Apr 01 2005 05:39 pm On Fri, 1 Apr 2005 12:27:52 -0800, Chris Thomasson <_no_damn_spam_cristom@_no_damn_comcast.net_spam> wrote: >> Yes. Though with classical RCU the quiesent states aren't so near the >> critical >> regions and the membars are around the quiesent state itself, so they're >> not >> near the critical regions either. But the RCU implementation I did uses >> membars like your example shows. > > Yeah. So does mine, I basically have it down to something like this: > > > // Acquire RCU > 1. store 1 into per-thread rcu_quiescent > 2. ( acquire barrier ) > 3. increment per-thread rcu_generation > > > // gc region > > > // Release RCU > 4. ( release barrier ) > 5. store 0 into per-thread rcu_quiescent > > > As long as step 3 is made visible before step 5 is made visible, everything > rocks. Plus, its loop-less and requires fewer memory barriers. Sure seems > there would be a lot less overhead when protecting the increments of a > single-word reference count... > With classical RCU, the quiescent states are voluntary context switches, so the RCU read lock and unlock macros are no-ops. That's about as less overhead as you can get. "classical RCU". It's been around for about 20 years now. :) -- Joe Seigh .