[LAD] some questions about writing a jack client

Paul Davis paul at linuxaudiosystems.com
Wed Nov 25 17:24:49 UTC 2009


On Wed, Nov 25, 2009 at 12:10 PM, Kjetil S. Matheussen
<k.s.matheussen at notam02.no> wrote:
>
> "Gabriel M. Beddingfield":
>> So you see, by using a mutex... you have to consider
>> those sections of code as being a part of your
>> process() function.
>
> Great explanation, but you forgot to explicitly mention
> that those sections of code also has to run with higher
> or equal priority as the jack process to avoid priority
> inversion.

and since (IIRC) linux/pthreads don't do this, you basically should
never use a lock in this fashion at all!

pthread_mutex_trylock() is fine. just avoid pthread_mutex_lock(). this
does require that you have some fallback strategy: what to do if you
can't take the lock.



More information about the Linux-audio-dev mailing list