One neat thing is, you don't actually need a spinlock if you're using a ringbuffer. You can use atomic increment on a counter to claim a slot, then write to that slot.<p>It can be between two to three orders of magnitude higher throughput. Equally important, lower latency.<p>(Throughput tends to be a consequence of low latency, but not always.)<p>I'm not saying this should be the norm, though. You probably don't need this design. But when you do, e.g. processing millions of stock market messages, there's no substitute.<p>EDIT: I love hearing about the designs and questions, but it was probably a mistake for me not to be explicit. Sorry! The thing I'm referring to is LMAX Disruptor pattern: <a href="https://lmax-exchange.github.io/disruptor/" rel="nofollow">https://lmax-exchange.github.io/disruptor/</a><p>I learned about it in 2011-ish, and it deeply changed my perspective on high speed designs.