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

Fons Adriaensen fons at linuxaudio.org
Fri Jul 8 17:17:34 UTC 2011


On Fri, Jul 08, 2011 at 09:21:55AM -0400, Paul Davis wrote:

> the one wrinkle in this is that in theory a compiler could so
> completely reorder instructions that even the basic assumptions that
> make the single reader/single-writer ringbuffer safe would break down.

AFAIK nothing fatal can happen if the variables involved are
declared volatile. A compiler is not allowed to omit, repeat,
or re-order instructions involving them.

Ciao,

-- 
FA




More information about the Linux-audio-dev mailing list