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

From: Joern Nettingsmeier <nettings@email-addr-hidden-hochschule.de>
Date: Sat Oct 18 2008 - 01:36:37 EEST

Fons Adriaensen wrote:
> On Fri, Oct 17, 2008 at 09:26:45PM +0200, Joern Nettingsmeier wrote:
>
>> i see. but what about the other scenario:
>> thread A reads read_ptr.
>> thread B runs and increments it.
>> thread A increases the old (wrong) read_ptr value by one and writes a
>> wrong value.
>>
>> isn't that a problem here?
>
> This can't happen. For both read_ptr and write_ptr
> only *one* of the two sides will ever modify it.
> That is really the basic idea behind all this.
> The other side just reads it, and will never read
> a value that could trigger an error.

ah, of course. one reader, one writer only. sorry for the noise.

-- 
jörn nettingsmeier
home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621
Kurt is up in Heaven now.
_______________________________________________
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 04:15:01 2008

This archive was generated by hypermail 2.1.8 : Sat Oct 18 2008 - 04:15:01 EEST