• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Correct API to implement a timer in a real-time thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Correct API to implement a timer in a real-time thread
      • From: Jeff Moore <email@hidden>
References: 
 >Correct API to implement a timer in a real-time thread (From: Stéphane Letz <email@hidden>)
 >Re: Correct API to implement a timer in a real-time thread (From: philippe wicker <email@hidden>)
 >Re: Correct API to implement a timer in a real-time thread (From: Stéphane Letz <email@hidden>)
 >Re: Correct API to implement a timer in a real-time thread (From: Jeff Moore <email@hidden>)

  • Prev by Date: Getting parameter info on StereoMixers
  • Next by Date: Re: Correct API to implement a timer in a real-time thread
  • Previous by thread: Re: Correct API to implement a timer in a real-time thread
  • Next by thread: Re: Correct API to implement a timer in a real-time thread
  • Index(es):
    • Date
    • Thread