Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is the time slice (quantum) that the Windows Kernel Dispatcher allocates to threads the same length for every thread, or does it base the size of quantum on the priority of the thread like Linux does?

share|improve this question
up vote 2 down vote accepted

Since the days of Windows NT, higher priorities applications have a larger quantum, for example for foreground threads.

32 priority levels are defined, 0 through to 31, with priorities 0 through 15 being "normal" priorities and priorities 16 through 31 being soft real-time priorities, requiring privileges to assign. 0 is reserved for the Operating System. Users can select 5 of these priorities to assign to a running application from the Task Manager application, or through thread management APIs. The kernel may change the priority level of a thread depending on its I/O and CPU usage and whether it is interactive (i.e. accepts and responds to input from humans), raising the priority of interactive and I/O bounded processes and lowering that of CPU bound processes, to increase the responsiveness of interactive applications

In Vista, the scheduler makes use of cycle counter registers in modern processors, and is able to estimate how many cycles a thread uses per clock tick. This way, the scheduler can divvy up CPU time much more fairly. A thread is allowed to run for another time slice after being interrupted, while before Vista the scheduler assumed that an interrupted thread ran for its entire time slice. (This indirectly increases the priority of a much-interrupted thread.) Vista also uses a priority scheduler for the I/O queue so that disk defragmenters and other such programs don't interfere with foreground operations.

Sources: wikipedia Scheduling, Vista Kernel Improvements.

share|improve this answer
The second link is dead, but it's still available at… – ComFreek Oct 7 '14 at 16:45
"Since the days of Windows NT, higher priorities applications have a larger quantum,". This is not accurate. A higher priority thread gets to pre-empt lower priority threads, but it doesn't get a longer quantum (timeslice) just because it has a higher priority. You are close, though, in mentioning foreground threads. Default behavior on client (non-Server) Windows OSs is that all threads in the process that owns the foreground window get timeslices 3x the normal length. But priority is a different thing. – Jamie Hanrahan Mar 27 at 15:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.