Re: [LAU] Simple, easy multithreaded circular buffer library for Linux?

From: Olivier Guilyardi <ml@email-addr-hidden>
Date: Wed Oct 15 2008 - 00:00:55 EEST

Kjetil S. Matheussen wrote:
> Olivier Guilyardi:
>>
>> For inter-thread communication there's Portaudio's ring buffer:
>> http://portaudio.com/trac/browser/portaudio/trunk/src/common/pa_ringbuffer.h
>>
>> It can easily be used out of Portaudio (I'm currently doing that), and it
>> features memory barriers [1] which AFAIK Jack's ringbuffer doesn't.
>>
>> One problem with everything Portaudio is this heavy naming scheme. For a simpler
>> API, you might like my little wrapper:
>> http://jackbeat.samalyse.org/browser/jackbeat/trunk/src/core/ringbuffer.h
>>
>
> Nice. It's probably quicker to copy the jack_ringbuffer.c file out of jack
> though.

This isn't the same as Jack's ring buffer. It's a little wrapper around
Portaudio's ring buffer, which as said above, features memory barriers. Jack's
ring buffer has no memory barrier AFAIK.

Using it in one's project is just a matter of copying 4 files.

More about memory barriers and lock-free ring buffers:
http://www.audiomulch.com/~rossb/code/lockfree/

This problem is also mentioned on the PulseAudio website:
http://www.pulseaudio.org/wiki/ThreadingModel (search for "barrier")

Cheers,

-- 
  Olivier Guilyardi / Samalyse
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user
Received on Wed Oct 15 00:15:03 2008

This archive was generated by hypermail 2.1.8 : Wed Oct 15 2008 - 00:15:03 EEST