Put a ring on it: a lock-free MPMC ring buffer
#HackerNews #lockfree #MPMC #ringbuffer #concurrency #data #structures #performance
Put a ring on it: a lock-free MPMC ring buffer
#HackerNews #lockfree #MPMC #ringbuffer #concurrency #data #structures #performance
Lockless MPSC/SPMC/MPMC queues are not queues
https://alexsaveau.dev/blog/opinions/performance/lockness/lockless-queues-are-not-queues
#HackerNews #Lockless #Queues #MPSC #SPMC #MPMC #Performance #Programming #Concurrency
Lockless queues let multiple cores communicate with each other without mutexes, typically to move work around for parallel processing. They come in four variants: {single,multi}-producer {single,multi}-consumer. A producer gives data to a consumer, each of which can be limited to a single thread (i.e. a single-{producer,consumer}) or shared across multiple threads. But only the single-producer single-consumer (SPSC) queue is actually a queue!
Flume, https://github.com/zesterer/flume.
A blazingly fast multi-producer, multi-consumer channel. It can be sync or async, which is pretty neat!
No unsafe code too.