Re: [LAD] Ring buffers again

From: Will J Godfrey <WillGodfrey@email-addr-hidden>
Date: Fri May 23 2014 - 21:14:43 EEST

On Thu, 22 May 2014 17:03:52 -0400
Paul Davis <paul@email-addr-hidden> wrote:

> On Thu, May 22, 2014 at 4:46 PM, Will Godfrey
> <willgodfrey@email-addr-hiddenwrote:
>
> >
> > As well as the jack ring buffer, I've looked at several others now, and
> > their
> > example code. The most significant thing that seems to be different about
> > them
> > (from a usage point of view) is the way they handle overflows. However, if
> > the
> > buffer size is defined as an exact multiple of the data type/structure and
> > only
> > complete structures are pushed or popped, would I be right in thinking
> > that you
> > would only need to check on an all/none basis?
> >
> > Have I missed something that could cause a partial data transfer?
> >
>
> the jack ring buffers are byte-oriented, so you do have to be careful.
> however, if both the reader and writer only ever increment their respective
> pointer/index in multiples of the same basic byte count, then you should be
> OK.
>
> if you use a C++ template ring buffer, then you necessarily cannot get
> partial transfers.

Thanks. It seems I'm on the right track then :)

-- 
It wasn't me! (Well actually, it probably was)
... the hard part is not dodging what life throws at you,
but trying to catch the good bits.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Sat May 24 00:15:02 2014

This archive was generated by hypermail 2.1.8 : Sat May 24 2014 - 00:15:02 EEST