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:10:58 -0700
Michael,
> 1) When a long-running task is being performed at an inappropriate
> priority, and it might be "nice" to let other threads have the CPU.
>
> In this case, I argue that the task should simply be moved to
> another thread that runs at an appropriate priority.
So let's say I realize that one of my threads is too far ahead of the
others in its computation. I want to slow it down, so I'll reduce its
priority.
Now imagine that 2 different users start 2 different instances of the app:
o User A starts the app with 2 threads TA1 and TA2, and this scenario
occurs, TA1 is way ahead of TA2, so TA1 lowers is priority.
o User B starts the app with only 1 thread TB.
At this point, user A loses: TA1 will almost never be scheduled anymore,
because TB will always have a higher priority.
I really want to lower the priority of my thread _within_ its task
(because the scheduling of that thread relative to the other in the same
task is a decision that can be best made by my app). But the APIs that I
find only allow me to do it system-wide.
So as a workaround, I want a way to yield the processor, i.e. go at the
end of the scheduling queue but with the exact same priority.
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