An asynchronous lock free ring buffer for logging #90
Replies: 4 comments 7 replies
-
|
Hi, thank you for very interesting article! But what do you think about using System.Threading.Channels for that purpose? |
Beta Was this translation helpful? Give feedback.
-
|
I'm always wary of lock-free code. It's quite difficult to get right (across all architectures). In this case, consider this situation:
|
Beta Was this translation helpful? Give feedback.
-
|
Isn't that just a queue with a capacity? Since the implementation doesn't override the head when its capacity is exhausted, why is it a 'ring buffer' and not just a 'fixed size / bounded queue'? |
Beta Was this translation helpful? Give feedback.
-
|
You could also consider using a robust and performant ring buffer implementation from an existing project such as https://github.com/disruptor-net/Disruptor-net/blob/master/src/Disruptor/RingBuffer%601.cs . That implementation is not only lock-free but has been highly performance tuned. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
An asynchronous lock free ring buffer for logging
In this blog post, I showcase a very simple lock-free ring buffer for logging. I'll show why it's useful and how it works.
https://steven-giesel.com/blogPost/11f0ded8-7119-4cfc-b7cf-317ff73fb671/an-asynchronous-lock-free-ring-buffer-for-logging
Beta Was this translation helpful? Give feedback.
All reactions