Re: Yielding the processor in a kext?
Re: Yielding the processor in a kext?
- Subject: Re: Yielding the processor in a kext?
- From: Michael Smith <email@hidden>
- Date: Fri, 7 Sep 2007 13:53:37 -0700
On Sep 7, 2007, at 10:10 AM, Régis Duchesne wrote:
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.
Hold on a second here.
You are massively confusing the situation. In your original request,
you did not describe what you were trying to do; you simply asked how
to yield to the scheduler whilst in a kernel context.
I assumed, incorrectly as it turned out, that you were trying to do
this for one of the two reasons that I have outlined in e.g. my reply
to Anton.
You are, in fact, not doing this; instead you are trying to manage a
long-running set of userland threads. I have detailed a set of co-
ordination schemes that could be applied to your problem in another
message.
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.
This is not a good approach. Co-ordinate between your threads in
order to keep them within an acceptable work delta of one another.
You can do this in user space if the work is there - there is no need
to have kernel code involved at all.
= Mike
_______________________________________________
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