Re: choice of thread API for audio feeder purposes
Re: choice of thread API for audio feeder purposes
- Subject: Re: choice of thread API for audio feeder purposes
- From: Bill Stewart <email@hidden>
- Date: Fri, 28 Mar 2003 19:40:55 -0800
Importance is preferred by many rather than directly setting priorites.
Basically a value of zero importance is the value of your main thread.
Positive importance values mean those threads are more important to you
than your main thread, negative values that they are less important.
These translate into priority values that are relative to the priority
of the main thread, but I keep getting told that this is the wrong way
to look at it - so I suspect that there is a desire to move people off
setting priorities directly... but rather to establish hierarchies of
importance for the different tasks that are run in different threads...
I guess that means that Real-Time threads have a value of infinite
(positive) importance:)
Bill
On Friday, March 28, 2003, at 03:42 PM, Kurt Bigler wrote:
You might as well just call mach_thread_self to get what you need in
order
to call thread_policy_set. Kurt Revis's code shows how to do that,
using
Objective-C:
http://www.snoize.com/Code/PlayBufferedSoundFile.tar.gz
However, this sets "importance" - I don't yet know the relationship
between
"importance" and "priority".
This of course avoids the issue of how to ask an NSThead for its
pthread or
its mach_thread by making the policy changes from within the thread
itself
when it starts running. No doubt there is a way to do it the other way
also.
-Kurt Bigler
on 3/28/03 10:57 AM, Bill Stewart <email@hidden> wrote:
pthread_self will give you this for any thread on the system
(ultimately all of the threads on X go down to this) - in the SDK
there's some code that shows how to use these API (both million
monkees
and PlayAudioFile)
Bill
On Thursday, March 27, 2003, at 08:06 PM, Andrew Kimpton wrote:
Christof Faller wrote:
Andrew,
Thanks for this instructive reply. At this point I do not use
threads
and do all in my callback. Therefore I once in a while get minor
audio "stalls", probably caused by a blocking file io call. For me,
using NSThread would be very easy and convenient. But by default an
NSThread has not high enough priority. Is there an easy way to
change
the priority when using NSThread?
I believe you should be able to get the underlying pthread identifier
from the NSThread (though I'll confess I'm not familiar with that
class, I'm mostly a C++ person) from their you can set the priority
using the mach thread API's - there's examples of how to do this in
the Million Monkeys source and in Bills WWDC presentation.
Chris
Andrew 8-)
_______________________________________________
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.
--
mailto:email@hidden
tel: +1 408 974 4056
______________________________________________________________________
__
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
______________________________________________________________________
__
__
_______________________________________________
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.
_______________________________________________
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.
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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.