Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scheduling question



On Jan 15, 2004, at 4:31 AM, Stefan Werner wrote:
So, using THREAD_PRECEDENCE_POLICY will only increase the priority of the thread within my process, but the priority of my thread will not be affected? If so, increasing the process' priority in addition should then give me the desired system-wide effect, I assume.

Yes, but unless you wrote every application/thread in the system, you'd only be guessing at a priority for your task (and potentially starting an arms race with all the other developers towards the highest possible priority - and then you're all just back to a simple round-robin scheme once you get there). That's why we recommend that the application developer NOT tweak the task/process-wide priority values. For one thing, if it's a GUI application, this will happen automatically as you switch in and out out of "front-most" application status. It wouldn't be good to have multiple entities fighting over those task-wide priority values in these cases.

One more question: If I change a thread's scheduling policy, will threads created from that one inherit that policy or will they have normal policy?

The creating thread is irrelevant. New threads pick up the default scheduling attributes of their containing task - or the supplied attributes on the create call (for pthread_create()).

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

References: 
 >Re: scheduling question (From: Stefan Werner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.