RCU-safe reference counting
Posted Jul 19, 2004 9:26 UTC (Mon) by
khim (subscriber, #9252)
In reply to:
RCU-safe reference counting by sjmadsen
Parent article:
RCU-safe reference counting
Never mind that cmpxchg() is a spinlock in different clothes.
Yes and no. It's reuse of existing "spinlock". Each and every access to every byte of RAM on SMP system is covered by "spinlock" anyway - think about cache cogerency! Yes, it's not really implemented as spinlock and there are different implementations of idea but the end result is the same: access to every byte in modern SMP systems is covered by "sort of spinlock" (and if two processors stomp each other feets too often system slows down to a crawl as you can guess). And cmpxchg() is using this feature - that's all. Since each and every access to any variable should be held with such "spinlock" held it's not slower then simple access without cmpxchg() function.
(
Log in to post comments)