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

From: Dan Kegel <dank@email-addr-hidden>
Date: Fri Jul 08 2011 - 22:29:01 EEST

On Fri, Jul 8, 2011 at 7:23 PM, Dan Muresan <danmbox@email-addr-hidden> 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
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Sat Jul 9 00:15:03 2011

This archive was generated by hypermail 2.1.8 : Sat Jul 09 2011 - 00:15:03 EEST