[alsa-devel] Lock free ring buffers and SMP safety

Matt Bucknall matt at mattbucknall.com
Sun Nov 18 18:31:52 CET 2007


Yes, this old chestnut. I've spent the best part of today trying to 
ascertain whether or not, in practical terms, a single-producer, 
single-consumer lock free ring-buffer can be written purely in C/C++ and 
be SMP safe on multiple architectures without memory barriers. 
Information I've found has been largely conflicting so I've given up 
trying to get a conclusive answer. Instead I'll just go with the flow.

What is the general consensus amongst ALSA application developers when 
it comes to implementing this kind of buffer? Is it possible to use 
memory barriers through some user space API call that I don't know about?

Thanks in advance for any comments/suggestions.

More information about the Alsa-devel mailing list