Posted Jan 3, 2008 12:44 UTC (Thu) by jzbiciak
(✭ supporter ✭
Parent article: What is RCU? Part 2: Usage
What exactly are the semantics of this unconditional reader-to-updater upgrade? I thought all writers were serialized, and readers never block with respect to each others or writers. Writers, once finished, updated the "current version" pointer atomically, so earlier readers see an older copy, and later readers and writers see a newer copy.
What happens when a reader wants to become an updater when another writer is already active? To me it seems like that that thread needs to get in line behind the existing writer.
For example, consider a monotonically increasing event counter, protected by RCU. All readers will see a monotonically increasing count. Writers, which must do a read-modify-write cycle to increment the count, work correctly as long as they serialize. What happens if a reader decides to write an incremented count all of the sudden? If there are other updaters in parallel, does the increment get dropped?
Am I misunderstanding the guarantees offered by RCU?
to post comments)