Re: [LAD] a *simple* ring buffer, comments pls?

From: James Morris <jwm.art.net@email-addr-hidden>
Date: Fri Jul 08 2011 - 11:40:41 EEST

On 8 July 2011 02:04, Gabriel M. Beddingfield <gabrbedd@email-addr-hidden> wrote:
> On Thursday, July 07, 2011 07:50:57 pm James Morris wrote:
>> I thought a "lock-free" ring buffer was supposed to be
>> the easy solution!
>
> It is... when you re-use one that's already been written and
> debugged.  ;-)
>
> Why not copy/paste the JACK ringbuffer (C) or even Ardours
> (C++ Container)?

I think that when I was coding BoxySeq, I did look at the JACK
ringbuffer code and decided to simplify it for my purposes. I "fixed
it" so there was no need for the byte count parameters for read/write,
and removed some of the functions I decided I didn't need (ie peek,
but then re-introduced my own versions). I found problems with my
implementation but it basically worked 99% of the time so I came back
to it the other day with the mistaken belief that atomic read/write
pointer operations along with a reduction of variables used for each
read/write operation would fix it. I was rather pleased actually with
how much this strategy made the code *look* cleaner, so surely it
would work!

James.

>
> -gabriel
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev@email-addr-hidden
> http://lists.linuxaudio.org/listinfo/linux-audio-dev
>
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Fri Jul 8 12:15:02 2011

This archive was generated by hypermail 2.1.8 : Fri Jul 08 2011 - 12:15:03 EEST