Re: Yielding the processor in a kext?
Re: Yielding the processor in a kext?
- Subject: Re: Yielding the processor in a kext?
- From: Régis Duchesne <email@hidden>
- Date: Fri, 07 Sep 2007 10:22:09 -0700
Michael,
> The problem here is that you are conflating "thread" with "work".
>
> Ideally you would parcel your work out in well-ordered units, and
> schedule those units to threads in such a fashion that progress happens
> with the desired balance.
That is great in an ideal world where you write the code that the
threads execute. But we don't live in an ideal world: in my case each
thread is like a black box: I control the initial input to these
threads, but then they go do their heavy computation, and just report
progress. What they do precisely to perform their computation is unknown
to me. All I know is that if I make them progress at the same rate,
whatever they compute will be computed faster overall (and more accurately).
>> We are wondering which API can be used to do that. Would an IOSleep(0)
>> (which is the way you do it on Windows) work or will it just be ignored?
>
> You don't want to do this, on either platform. You have no control over
> what "slow it down" actually means, and you aren't communicating what
> you really want to the scheduler.
I have perfect control on Windows where Sleep(0) is documented to do
exactly what I want. I have perfect control on Linux where
cond_resched() is documented to do exactly what I want. I'm trying to
have perfect control on Mac OS by finding an API that is documented to
do exactly what I want :)
Thanks,
--
hpreg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden