AndersKaloer/Ring-Buffer

Can I use it without lock when slow producer and fast consumer?

Closed this issue · 1 comments

If I have two thread , one is a very slow producer and another is a very fast consumer .

Can I use your ringbuffer without lock ? and without any memory barrier ?

You should not use the ring buffer from multiple threads without a lock. The speed of the producer/consumer does not change that.
Unless the threads are synchronized in some other way, using it without a lock will most likely result in failure at some point.