Re: Correct API to implement a timer in a real-time thread
Re: Correct API to implement a timer in a real-time thread
- Subject: Re: Correct API to implement a timer in a real-time thread
- From: Herbie Robinson <email@hidden>
- Date: Thu, 5 Jan 2006 17:31:06 -0500
At 12:08 PM -0800 1/5/06, Jeff Moore wrote:
The HAL uses the CAGuard class from the Public Utilities in the
CoreAudio SDK to handle all it's scheduling needs. CAGuard simply
wraps up a pthread mutex and cond var as a unit. CAGuard uses the
function pthread_cond_timedwait_relative_np() to handle blocking the
thread for a specified amount of time. If I remember right, the
difference between this function and the pthread_cond_timedwait() is
that in the former you pass the interval to wait and the latter you
pass the time to wake up. The reason for this is purely because of
the implementation of CAGuard. In fact, if you look at the
implementation of pthreads in Darwin, you'll find that
pthread_cond_timedwait() is implemented pretty much the same way
that CAGuard::WaitUntil() is.
Didn't one of your co-workers post that the pthreads implementation
uses a global lock that can cause priority inversion; so, at least
some pthreads calls aren't safe to use in real-time threads?
Has this been fixed and/or is there some safe set of pthreads calls?
--
-*****************************************
** http://www.curbside-recording.com/ **
******************************************
_______________________________________________
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