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

From: Paul Coccoli <pcoccoli@email-addr-hidden>
Date: Sun Oct 19 2008 - 19:36:55 EEST

On Sun, Oct 19, 2008 at 12:24 AM, Jack O'Quin <jack.oquin@email-addr-hidden> wrote:
> On Sat, Oct 18, 2008 at 10:45 PM, Paul Coccoli <pcoccoli@email-addr-hidden> wrote:
>> On Sat, Oct 18, 2008 at 11:29 PM, Jack O'Quin <jack.oquin@email-addr-hidden> wrote:
>>> This is wrong. For the single reader, single writer case, atomic operations
>>> are *not* necessary. The bug, as was already pointed out, is due to storing
>>
>> Let's agree to disagree, then. Single-reader, single-writer does not
>> automatically make something SMP safe. There is large body of
>> literature on lock-free data structures that agrees with me; someone
>> posted a link to a collection of those earlier in the thread.
>
> Let's not. This is not just a matter of opinion. If you read that literature,
> you will find that the ring buffer *is* safe for the single reader,
> single writer
> case. In many other SMP situations, atomic operations *are* required,
> but not for ring buffers.

The only time you can get away without atomic ops is on uni-processor.
 Please cite a reference that says otherwise.

Notice that all the fixes proposed all involve removing the "+=" and
using only assignment.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Sun Oct 19 20:15:02 2008

This archive was generated by hypermail 2.1.8 : Sun Oct 19 2008 - 20:15:02 EEST