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

From: Fons Adriaensen <fons@email-addr-hidden>
Date: Fri Oct 17 2008 - 23:05:45 EEST

On Fri, Oct 17, 2008 at 08:36:56PM +0200, Olivier Guilyardi wrote:

> I don't see why it's fragile. There's no reason for the compiler to modify
> rb->read_ptr if not asked to. Buf if that's the case, because of some sort of
> dark voodoo optimization, then we could use a temporary variable to hold the
> intermediary result. Better, all computation could be done on this temporary
> variable and transfered into rb->read_ptr once finished, so that modifying the
> later only involves memory copy.

There is no reason indeed, and only a completely braindead
compiler would do it unless forced to, but it is not formally
excluded unless you make read_ptr volatile. Using a temporary
variable doesn't change the picture at all.

Ciao,

-- 
FA
Laboratorio di Acustica ed Elettroacustica
Parma, Italia
Lascia la spina, cogli la rosa.
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user
Received on Sat Oct 18 00:15:05 2008

This archive was generated by hypermail 2.1.8 : Sat Oct 18 2008 - 00:15:06 EEST