Think about your question. You are asking 'can I increase the scheduler granularity without changing the scheduler granularity’.
The only way two ways to wait are to spin (busy loop) or to interact with the scheduler. The scheduler is the part of the OS that handles thread scheduling, and spinning just relies on hardware. You have to pick one or the other.
Rather that looking at how you might wait without spinning, if you are really concerned about CPU usage, you should look at why you need to wait in the first place and try to eliminate it by changing to an async model (which may not be possible depending on your hardware)
Sent from Surface Pro
From: xxxxx@gmail.com
Sent: Saturday, December 13, 2014 1:52 PM
To: Windows System Software Devs Interest List
Many would have asked this question already in this forum. But I just wanted to check one last time before answering to my client about this.
I want to add delay in my driver for a few microseconds with out busy looping on the CPU (thus not using kestallexecutionprocessor) since this is increasing the CPU utilisation when all of the hardware devices are in use simultaneously.
I cannot use kedelayexecutionthread since It puts the the current thread to sleep which gets woken up only after 15 milliseconds or so due inherent limitation of windows thread dispatchers scheduling granularity ( appreciate any corrections to this statement in case it is not proper).
Without changing the clock related setting on my system (so that dispatcher gets invoked more frequently) is there any way I can put a kernel thread to sleep only for a few microseconds but not more than that?
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer