• 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: Audio threads scheduling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio threads scheduling


  • Subject: Re: Audio threads scheduling
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 31 Mar 2004 12:10:36 -0800

The computation value indicates the initial period for which the thread will not be pre-emptible. I believe that this is implemented in scheduler by when it sets the decrementer interrupt to next go off.

The HAL chooses the value for this parameter so that shorter IO cycles get more time to not be pre-emptible and longer cycles become pre-emptible sooner. This, in effect, prioritizes the shorter cycle over the longer cycle.

This prevents a priority inversion that can occur when there are cycles with both large and small durations in which the IOProcs are using reasonable CPU loads. For instance if both Process A and Process B are using 25% CPU load in their respective IOProcs, but A's cycle is 4000 frames long and B's cycle is 100 frames long. If A's cycle didn't become pre-emptible quickly enough, it would easily cause B to miss many of it's cycles, even though both processes are using reasonable CPU loads.

It also encourages IOProcs to execute faster so the thread can go back to sleep as this is less likely to get pre-empted.

On Mar 31, 2004, at 1:10 AM, Stiphane Letz wrote:

Hi,

I've made some test to undersand the audio thread scheduling parameters. Here are the value I get using the "thread_policy_get" function to retrieve the scheduling parameters for various buffer size :


Frames : period : computation : constraint : preemptible

32 725 499 725 1
48 1080 499 1080 1
64 1451 499 1451 1
128 2902 299 2902 1
256 5804 99 5804 1
512 11608 99 11608 1

As expected the period and constraint values are directly related to the buffer size, but I don't understand how the value of the computation parameter are choosen.

Any comments?

Regards

Stephane Letz
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.



--

Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Audio threads scheduling
      • From: Jeff Moore <email@hidden>
References: 
 >Audio threads scheduling (From: Stéphane Letz <email@hidden>)

  • Prev by Date: PlayAudioFileLite adds
  • Next by Date: Re: Audio threads scheduling
  • Previous by thread: Audio threads scheduling
  • Next by thread: Re: Audio threads scheduling
  • Index(es):
    • Date
    • Thread