• 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: time constraint policy and audio proc calls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: time constraint policy and audio proc calls


  • Subject: Re: time constraint policy and audio proc calls
  • From: Kurt Revis <email@hidden>
  • Date: Wed, 12 Dec 2001 04:49:59 -0800

Following up to this very useful post from a few weeks ago, with some more details:

On Monday, November 19, 2001, at 12:26 PM, Jeff Moore wrote:

computation: the amount of time until the thread can be pre-empted
Feeder thread's should be pre-emptible after a very very small amount of
time, if not immediately. So, set this number very small, if not to 0.

I tried to set a thread's scheduling policy to time-constraint, using a 0 value for computation as you suggested. However, the thread_policy_set call always returned an error (KERN_INVALID_ARGUMENT).

Fortunately, it was really easy to find this function in the Darwin kernel source. It turns out that values for computation must be strictly between min_rt_quantum and max_rt_quantum. Currently those two values are hard-coded to be 50 microseconds and 50 milliseconds, as far as I can tell. So I set my computation to 50 us, and it worked fine.

Hope this helps someone save some time. (It is really cool to be able to look at the kernel source... this part, at least, was not nearly as daunting as I expected it to be.)

--
Kurt Revis
email@hidden


  • Prev by Date: RE: coreaudio-api digest, Vol 1 #158 - 6 msgs
  • Next by Date: Using MidiMan Delta 66 drivers.
  • Previous by thread: Re: USB devices changing UIDs
  • Next by thread: Using MidiMan Delta 66 drivers.
  • Index(es):
    • Date
    • Thread