Change processor quantums to tweak application priority

When running several applications/processes simultaneously then a coordinator/scheduler is needed to make sure that all applications get a fair quantum/slice of the CPU time. The coordinator can be configured in how it gives CPU quantums to the different applications running.
  • Foreground vs. Background: Foreground boost means that the application currently having focus will get more quantums than other applications, thus it will not be disturbed that much by background processes. Background means that all applications gets equal amount of CPU quantums.
  • Short vs. Long (Win2k+): Short quantums means that applications can hold the CPU for a short time, thus giving smooth multitasking. Long quantums means that applications can hold the CPU for longer time, thus spending less time on process switching.
  • Variable vs. Fixed (Win2k+): Variable quantums means that the foreground application can hold the CPU for a longer time. Fixed quantums means that the CPU time within a quantum is the same for all applications (Though some applications can get more quantums than others).
In WinNT4/Win2k/WinXP this setting can be configured at "Control Panel" -> "Systerm Properties" -> Advanced-tab -> "Performance Options...".

The above setting reflects this DWORD value in the registry:

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Control \PriorityControl]
Win32PrioritySeparation = 0

For the WinNT4 there are the following values:
  • 0 - Equal priority for all applications
  • 1 - Medium priority to foreground application
  • 2 - High priority to foreground application

    More Info MS KB232271
For the Win2k/WinXP the value set have been extended by using three 2 bits values:
6-5 Bit4-3 Bit2-1 BitResult
10 (32) Short Quantum
01 (16) Long Quantum
00 (0) Default (Prof.=Short, Srv.=Long)
10 (8) Fixed Quantum for all
01 (4) Variable Quantum for foreground
00 (0) Default (Prof.=Variable, Srv.=Fixed)
10 (2)High foreground boost/priority (3 times higher)
01 (1) Medium foreground boost/priority (2 times higher)
00 (0) No foreground boost/priority
By adding each 2 bit value together you will get a value to use in the registry key. Examples:
  • Optimize Performance for Applications: 32 + 4 + 2 = 38 and gives Short Quantum, Variable Quantum for foreground, High foreground boost.
  • Optimize Performance for Background Services: 16 + 8 + 0 = 24 and gives Long Quantum, Fixed Quantum, No foreground boots.
More Info Inside Win2k
More Info MS Technet

Related Specify base priority when launching programs

Updated: 12 December 2012

Comments:

  1. spiros says:

    You say:
    10 (8) Variable Quantum for foreground
    01 (4) Fixed Quantum for foreground

    Microsoft sais:
    01 Variable-length intervals
    10 Fixed-length intervals

    Somebody is wrong.

    microsoft url

  2. snakefoot says:

    spiros
    You say:
    10 (8) Variable Quantum for foreground
    01 (4) Fixed Quantum for foreground

    Microsoft sais:
    01 Variable-length intervals
    10 Fixed-length intervals

    Somebody is wrong.

    Just read through the Microsoft articles and confirmed with sysinternals.com homepage, that I'm the one who is wrong.

    It also makes more sense that when optimizing for applications then the foreground application gets a variable quantum.

    Thanks for noticing and sorry about the confusion.

Leave a Reply

Your email address will not be published. Required fields are marked *