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 15:36:30 -0700
Anton,
> (void)thread_block(THREAD_CONTINUE_NULL);
> And best of all thread_block() is exported in Mach.exports so it is a
> stable kernel API. Definitely worth a try I would think! If it hangs
> (I don't think it will but I may have misunderstood!) or if it always
> schedules the same process back (I don't think it will do that either!)
> then you haven't lost anything but if my reading of the scheduling code
> is correct this will indeed perform a context switch to the next in line
> task on the run queue and will keep doing this until your task gets to
> be the next in line and the context switch then brings your task back
> and thread_block() returns.
>
> Note as I read the code when your task is the only task on the run queue
> thread_block() will simply return immediately.
>
> PS. If you try this I would be very grateful if you tell me how it
> worked out as I have already spent too long looking at the code when I
> have lots of other work to do!
Looks promising. Thanks for your investigation. I'll definitely give
this a try and report my findings.
--
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