2 ms·
One of my favorite patterns. The implementations of this for C# support a value type as the buffer object. You can get upward of a half billion events per seco
by bob1029 2y ago
One of my favorite patterns.
The implementations of this for C# support a value type as the buffer object. You can get upward of a half billion events per second in a SPSC arrangement.
My use cases for it are primarily in gaming or where I have a latency critical element. C#/.NET isn't necessarily ideal for these use cases, but you can do clever things like align GC to the disruptor batch processing boundaries.
If you are finding trouble with this pattern on small machines (1-2 cores), consider adding a heuristic that checks the core count of the machine and swaps from busy to a yielding wait strategy if there aren't at
least 4 cores. Yielding wait isn't always good enough, but it definitely works for testing and prototyping.
- neonsunset 2y agoIs the company that uses this perchance located in Europe?