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

Joern Nettingsmeier nettings at folkwang-hochschule.de
Fri Oct 17 18:36:37 EDT 2008


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.



More information about the Linux-audio-user mailing list