Re: Yielding the processor in a kext?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Sep 6, 2007, at 5:03 PM, Régis Duchesne wrote: I understand that by default threads executing in the kernel are pre-emptable, but sometimes I would like the current thread to explicitly give the scheduler a chance to schedule another thread, before the current thread's timeslice has elapsed. I'm looking for something similar to cond_resched() on Linux. = Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Is there a way to make the current thread yield the processor in a kext? Not in the fashion you describe. If you have work, do it. If the scheduler has more important work that has to be done, it will take the CPU away from your thread. The only reason to want to do this is if you are performing a long- running low priority task on the wrong (high-priority) thread. Don't do that. Do the work on a thread whose priority reflects the true priority of the task. It's not your business to make scheduling decisions; don't even try. This email sent to site_archiver@lists.apple.com
participants (1)
-
Michael Smith