Re: RCU+SMR
- From: Joe Seigh <jseigh_01@xxxxxxxxxx>
- Date: Fri, 01 Jul 2005 08:43:24 -0400
Joe Seigh wrote:
Way back, I came up with a scheme where you make the queue a lock-free LIFO stack using compare and swap. The single reader just grabbed the entire queue using compare and swap, reversed order making it FIFO and worked off of that util it was empty and then repeated the whole process by grabbing the shared LIFO stack again.
Actually, the original was just a doubly linked list with the reader filling in the back links as needed. You don't even need to ever dequeue from the queue anchor if you just leave that last element on the queue as a place holder. There's some cache hit to the reader doing the reverse linking but probably less overall than some complicated lock-free fifo queue algorithms. If you had spare hardware threads, you could have one doing the reverse linking in parallel with the reader thread and improve latency for the reader thread.
Haven't done that kind of stuff in a while. Usually, I'm doing single writer, multiple reader lock-free queues for multi-casting.
-- Joe Seigh
When you get lemons, you make lemonade.
When you get hardware, you make software. .
- References:
- Re: RCU+SMR
- From: Joe Seigh
- Re: RCU+SMR
- From: Joe Seigh
- Re: RCU+SMR
- From: Joe Seigh
- Re: RCU+SMR
- From: Lefty Bigfoot
- Re: RCU+SMR
- From: Joe Seigh
- Re: RCU+SMR
- From: Jomu
- Re: RCU+SMR
- From: Joe Seigh
- Re: RCU+SMR
- From: David Hopwood
- Re: RCU+SMR
- From: Joe Seigh
- Re: RCU+SMR
- Prev by Date: Re: returning arguments
- Next by Date: Re: Linux thread weird problem..
- Previous by thread: Re: RCU+SMR
- Next by thread: Re: RCU+SMR
- Index(es):
Relevant Pages
|
Loading