The windows dispatcher (scheduler) is not a single process/thread; it is spread across the kernel. The dispatcher is generally triggered by the following events:
- Thread becomes ready for execution
- Thread leaves running state (e.g. quantum expires, wait state, or done)
- The thread's priority changes (e.g.
SetThreadPriority
) - Processor affinity changes
I need to boost the priority of a 'small task thread' within < 1 ms. Is this possible?
According to 3: Yes, the dispatcher will reschedule immediately.
Ref.: Windows Internals Tour: Windows Processes, Threads and Memory, Microsoft Academic Club 2011