Live data from Hacker News

Optimizing a lock-free ring buffer

david.alvarezrosa.com

1–10 of 100 posts

Re: Optimizing a lock-free ring buffer

#6
From 12M ops/s to 305 M ops/s on a lock-free ring buffer.

In this post, I walk you step by step through implementing a single-producer single-consumer queue from scratch.

This pattern is widely used to share data between threads in the lowest-latency environments.

Re: Optimizing a lock-free ring buffer

#10

This is in C++, other languages have different atomic primitives.

Really? Pretty much all atomics i’ve used have load, store of various integer sizes. I wrote a ring buffer in Go that’s very similar to the final design here using similar atomics.

https://pkg.go.dev/sync/atomic#Int64

Post reply on HN