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

From: Tim Blechmann <tim@email-addr-hidden>
Date: Wed Jul 13 2011 - 12:09:16 EEST

>> no one can write a test case which fails when
>> memory barriers are missing in a ringbuffer implementation.
>
> That's an interesting assertion. It's kind of tempting to write some
> buggy circular buffers and test that assumption on common hardware.

in fact, testing is not the best approach for verifying lock-free data
structures: an implementation may work for years, if a certain condition is
never triggered. the only reasonable way to ensure the correctness is a formal
proof. unfortunately, most publications assume a sequencially consistent memory
model and sometimes even avoid dealing with the ABA problem.

fortunately the atomics of c++0x/c1x will make it much clearer (and more robust
as the memory order argument to the atomic functions defaults to sequencial
consistency)

cheers, tim

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Wed Jul 13 12:15:01 2011

This archive was generated by hypermail 2.1.8 : Wed Jul 13 2011 - 12:15:02 EEST