Re: [RFC] Ring buffers


Dmitriy Korovkin
 

On Fri, 23 Sep 2016, Boie, Andrew P wrote:

On Fri, 2016-09-23 at 13:27 -0700, Boie, Andrew P wrote:
NACK, for reasons below.
Just to qualify this -- if you wanted to create a general purpose
kernel object type that builds on what is in ring_buffer.h, I would not
be opposed.

But I want the existing definition left as-is as it is intentionally
lightweight and for scenarios where you have a single producer and
single consumer you don't need extra concurrency control.
Just for the clarification.
I never stated the idea of concurrency protocol. As I stated previously,
the idea that is discussed here is to make ring buffers available for
users the same way as it is done for other kernel objects, which is for
unified kernel means placing object declaration into kernel.h. Not that
having heder in another place makes it unavailable, it is a matter of
convenience.

Next, when I was saying of making reading thread wait if the buffer is
empty and writing thread wait if there is no free space, this does not
resolve and does not intend to resolve the problem of several concurrent
threads trying to access the ring buffer - such a problem may be resolved
with mutexes.

My apologies, if I did not make it clear enough, I hope I have done it now
to avoid the further confusion.

Regards,
/Dmitriy.

Join devel@lists.zephyrproject.org to automatically receive all group messages.