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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Coccoli wrote:
> On Fri, Oct 17, 2008 at 1:20 PM, Olivier Guilyardi <ml@xxxxxxxx> wrote:
>> Paul Coccoli wrote:
>>>
>>> rb->read_ptr += n1;
>>> rb->read_ptr &= rb->size_mask;
>>>
>>> Looks like a problem to me.  What happens if there's a context switch
>>> in between those 2 statements?
>>>
>> Well, it looks like you had a fast but great insight here. I've turned all
>> statements of this kind into one-liners, and the jack ringbuffer now
>> (apparently) passes the test.
> 
> Looks like I don't have to "step back" or "read the whole thread for
> links to relevant documents" then ;)

No that's right, you just stepped forward ;)

>> Here's the patch against jack1 r3007:
>> http://svn.samalyse.com/misc/rbtest/patches/jack-r3007-rb-fix.diff
>>
>> And thanks everyone for the tests ! I've updated the test suite, it now contains
>> an additional test with this patch. Please continue testing :)
>>
> 
> I didn't test your patch, but my own patch (which is the same thing)
> works on dual Core2 duo system, whereas the original didn't.
> 
> No memory barriers needed *on x86* (volatile isn't needed anywhere).
> Others system probably need memory barriers.

Indeed, from what I read, PowerPC might need them. Could anyone run these tests
on a PowerPC, ideally SMP?

Btw, do you think there's a need to write more elaborated tests, something like
writing/reading data chunks of random sizes for example ?

-- 
  Olivier Guilyardi / Samalyse
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user

[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux