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

Dan Kegel dank at kegel.com
Fri Jul 8 19:29:01 UTC 2011


On Fri, Jul 8, 2011 at 7:23 PM, Dan Muresan <danmbox at gmail.com> wrote:
> (http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html):
>...
> The only thing that volatile accomplishes is to slow down
> properly-synchronized programs. volatile is for signal handlers and
> interrupt handlers, not for threading.
>...
> This reordering cannot be prevented without proper synchronization. So
> my advice to anyone considering this would be to drop volatile and do
> proper synchronization at the application level (i.e. semaphores,
> since it has to work in real time).

+1

volatile is not the droid you're looking for.
- Dan



More information about the Linux-audio-dev mailing list