site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com I would like to lower the priority of a background thread in my kext. I'm using thread_policy_set() with the THREAD_PRECEDENCE_POLICY. At best I am making a guess at what the importance number should be for this thread. I'd have a better understanding of what to use for importance if I could call thread_policy_get() except that thread_policy_get() is not exported <sigh>. This one thread is a background thread while most of the other threads are IO requests from userland, so I'm assuming I really shouldn't be changing any priorities there. "Using Mac Scheduling From User Applications" says that an importance number of 0 is idle, described as "threads set to IDLE_PRI will only execute when no other thread is scheduled to execute." This seems too low for my purposes; that is i'd like it to run sometimes, just not as high priority as the IO request threads. Another part of "Using Mac Scheduling From User Applications" says "While this is a signed 32-bit value, the minimum legal value is zero (IDLE_PRI)." However, some reading in past emails use negative values for importance. (I can't even find a definition for IDLE_PRI). How can I determine an appropriate value for importance? Or is there a better way to lower the priority of this thread? Some background on this thread. This thread does not run all the time. It is called upon to do a lot of work for a period of time and then stop. The work is in competition with the IO requests, but should have a lower priority to ensure that the IO requests get through in a reasonable amount of time. Thanks for any tips on how to lower the priority of this background thread. ...Duane _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com