[LAD] how to store deferred events in a real time audio app?

Paul Davis paul at linuxaudiosystems.com
Tue Dec 20 15:01:26 UTC 2011


On Tue, Dec 20, 2011 at 8:24 AM, Tim Goetze <tim at quitte.de> wrote:

> Alternatively, out-of-order queuing can be dealt with by sorting the
> contents of the FIFO in the consuming thread (since the write position
> only ever increases, sorting everything before it is safe).

as long as the length of the FIFO is relatively small, this is true.
sorting is rarely linear though, so you need to be careful if you want
this to scale to absurdly large message queues :)

>  Multiple
> writers can be supported locklessly by employing one FIFO per writing
> thread (the consuming thread peeks at the contents of all FIFOs before
> deciding which event to pop first).

true, though this is more complex for the reader, and the writers are
rarely under RT constraints which means that the serialization via a
lock doesn't hurt anyone.



More information about the Linux-audio-dev mailing list