Re: Yielding the processor in a kext?
Re: Yielding the processor in a kext?
- Subject: Re: Yielding the processor in a kext?
- From: Anton Altaparmakov <email@hidden>
- Date: Fri, 7 Sep 2007 23:46:59 +0100
Hi Régis,
On 7 Sep 2007, at 23:36, Régis Duchesne wrote:
(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.
You are welcome!
I'll definitely give this a try and report my findings.
Great, looking forward to them. (-:
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/
_______________________________________________
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