Re: [LAD] some questions about writing a jack client

From: Paul Davis <paul@email-addr-hidden>
Date: Wed Nov 25 2009 - 19:24:49 EET

On Wed, Nov 25, 2009 at 12:10 PM, Kjetil S. Matheussen
<k.s.matheussen@email-addr-hidden> 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.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Wed Nov 25 20:15:05 2009

This archive was generated by hypermail 2.1.8 : Wed Nov 25 2009 - 20:15:05 EET