[linux-audio-dev] Re: lock-free data structures

Tim Hockin thockin at hockin.org
Sat Jun 19 23:58:15 UTC 2004


On Sat, Jun 19, 2004 at 01:48:43PM +0300, Juhana Sadeharju wrote:
> >http://en.wikipedia.org/wiki/Memory_barrier
> 
> What it means practically? Any code? (Cannot check wikipedia now.)

Practically, there are memory barrier implied instructions.  See the Linux
kernel for examples.  I don't know how possible it is to bring all that to
user space, especially across platforms.

> Quick question: disk thread may suspend if there are no disk use.
> How the disk thread is woken up to read the lock-free buffer?

Semaphore.  Every time you put something into the buffer, up() the
semaphore (after).  Every time you want to take something from the buffer,
down() the semaphore, first.



More information about the Linux-audio-dev mailing list