Re: render callback + pthread_cond_signal
Re: render callback + pthread_cond_signal
- Subject: Re: render callback + pthread_cond_signal
- From: Paul Davis <email@hidden>
- Date: Thu, 28 Oct 2010 22:34:35 -0400
On Thu, Oct 28, 2010 at 9:46 PM, <email@hidden> wrote:
> Scott Burgess wrote:
>> Is calling pthread_cond_signal() from an AU render callback cool?
>
> Yes and no ... you have to do it without acquiring the condition
> variable mutex, which can lead to race conditions.
Not quite true. You have to do it without a blocking attempt to
acquire the mutex. If you use pthread_mutex_trylock() and check the
result, there's no risk. However, you then need a fallback strategy
for the case where you don't get the lock.
> The best method AFAIK is to use mach semaphores.
We use Mach semaphores for IPC within JACK. There's been some question
recently whether the POSIX semaphore implementation in OS X is good
enough for this too. On linux, the implementation has changed quite a
lot over the last 10 years and its not the faster IPC notification
mechanism on that platform. My impression is that Mach semaphores are
still significantly better than POSIX semaphores on OS X ....
--p
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden