Re: coreaudio-api digest, Vol 2 #365 - 12 msgs
Re: coreaudio-api digest, Vol 2 #365 - 12 msgs
- Subject: Re: coreaudio-api digest, Vol 2 #365 - 12 msgs
- From: Stephane Letz <email@hidden>
- Date: Tue, 5 Nov 2002 10:12:20 +0100
>
With Jaguar the scheduler will not pre-empt TC threads (though given
>
the existence of the preemtible flag this may *not* always be the
>
case...
>
>
Basically with the TC threads one of the fields that you provide as
>
part of the TC is the computation bounds:
>
thread_time_constraint_policy_data_t thePolicy;
>
thePolicy.period = mPeriod;
>
thePolicy.computation = xxx
>
>
This value (which is in nanoseconds) determines the period of time
>
which a TC thread will run before the scheduler will consider another
>
thread of equal priority to execute. If the TC thread is still running
>
after that quantum of time, the scheduler checks to see if there is
>
another TC thread, if so, the current thread goes to the back of the TC
>
thread queue, the next TC thread executes until either its quanta of
>
time elaspses, or it sleeps... and so on until there are no runnable TC
>
threads...
>
>
Because of this, we set the computation bounds of TC threads in the HAL
>
differently based on buffer size of that I/O Proc (as that represents
>
some period of time).
>
>
Imagine two I/O Procs (in different processes):
>
(1) Has a buffer size of 512/44.1K -> so approx 11msec
>
(2) Has a buffer size of 128/44.1K -> approx 3 msec
>
>
If (1) does a lot of work (say it takes 4 msecs to do its thing), (2)
>
still has to run every 3 msecs or it will miss.
>
>
So, we set the computation quanta for (1) to be small - 100 nanos. -
>
For (2) we set it higher (300 nanos) - In the testing we did with this
>
we were able to run both processes where they both do substantial work,
>
but not sufficient in combination to overload the machine or overload
>
their individual time constraints.
Could you explain how precisely these numbers (100 and 300) are computed
from the buffer size?
Could you explain also how the Time Constraint values for the Midi RT
thread are set and how Midi RT and audio RT threads are interleaved?
Thanks
Stephane Letz
Grame: Centre National de creation musicale
9, Rue du Garet
69001 Lyon
Tel: 04-72-07-37-00
Fax: 04-72-07-37-01
Web: www.grame.fr
_______________________________________________
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.