News for hackers. Stuff that matters.
Re:A lock-free ring-buffer with contiguous reservations (2019) by zengid on Thursday February 29, 2024 @11:19AM (#39551366)
Not if your program needs to be realtime or near realtime safe. Locks are controlled by the OS typically, and can have non-deterministic latency.
Re:A lock-free ring-buffer with contiguous reservations (2019) by loeg on Thursday February 29, 2024 @11:34AM (#39551602)
Even ignoring mutexes and OS scheduling, plain spinlocks add contention that would not otherwise exist in a SPSC ringbuffer. https://news.ycombinator.com/item?id=39551575