Re: [linux-audio-dev] Lock Free Ringbuffer in C ?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Lock Free Ringbuffer in C ?
From: torbenh_AT_gmx.de
Date: Fri Apr 04 2003 - 18:15:49 EEST


On Fri, Apr 04, 2003 at 12:47:28PM +0200, David Olofson wrote:
> On Thursday 03 April 2003 15.36, torbenh_AT_gmx.de wrote:
> > i remember i have read a statement about a lock free ringbuffer
> > implemented in C somewhere.
> >
> > Can anybody remeber it ?
>
> Here's one in C; the 'sfifo':
>
> http://olofson.net/mixed.html
>
>
> I've been using it in various environments for a few years, but that
> doesn't guarantee anything. ;-)

well... it should for such small code :)

but how do i handle this sensibly ?

        res = sfifo_write(sf, &buf, j);
        if(res != j)
        {
                printf("Write failed!\n");

// eeek... no i dont want that...
                sleep(1);
        } else if(res)
                printf("Wrote %d\n", res);
>
>
> //David Olofson - Programmer, Composer, Open Source Advocate
>
> .- The Return of Audiality! --------------------------------.
> | Free/Open Source Audio Engine for use in Games or Studio. |
> | RT and off-line synth. Scripting. Sample accurate timing. |
> `-----------------------------------> http://audiality.org -'
> --- http://olofson.net --- http://www.reologica.se ---
>

-- 
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Apr 04 2003 - 14:43:35 EEST