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

Juhana Sadeharju kouhia at nic.funet.fi
Mon Jun 21 08:34:53 UTC 2004


>From: Tim Hockin <thockin at hockin.org>
>
>> 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

So, one thread for RT-audio, one thread to watch and suspend on
semaphores, and one thread to select() on FDs (for communication
from the application and from the semaphore watcher).

Which one is better?
 (1)  RT-audio thread ---> pipe ---> select() thread
 (2)  RT-audio thread ---> semaphore --> semaphore watcher thread
        --> pipe --> select() thread

Of course, better for RT-audio thread. While the case (2) is
more complex, it could be better for RT-audio thread.

How this all is done in Ardour? I browsed the source but there are
a lot of stuff there. How about LinuxSampler?

Juhana



More information about the Linux-audio-dev mailing list