Although modern operating systems appear to multitask and run multiple programs in parallel, it is really just smoke and mirrors. Even on multi-core processor systems, each core can only perform a single task at any time, but to allow an operating system like Microsoft Windows Vista to run multiple applications at the same time, CPU makers have introduced technologies such as CPU switching and segmentation, which in turn allow the operating system to divide all of the available application processing time and allocate this time to the processes that need to run. But every running process could potentially run multiple threads, so increases work of the operating system to ensure that a single process does not hog a CPU and degrade performance.
CPUs spend small amount of time on each process, these units of time are called quanta. The quantum value has nothing to do with base priority. The quantum defines the amount of time spent on that particular process. For an in depth look at the differences between various processor-scheduling algorithms try this link en.wikipedia.org/wiki/Scheduling_%28computing%29. One of the more accessible methods that Windows Vista uses to divide processing time between applications is Base priority Level. Every application that runs under Windows Vista is assigned a base priority level at runtime, the majority of applications started by the operating system run at “Normal” base priority. There are six available application priorities in Windows Vista:
- Realtime:24 (Highest available base prioritiy)
- High:13
- Above Normal:10
- Normal:8
- Below Normal:6
- Low:4 (Idle base prioritiy)
So understanding that Windows Vista will start most applications with a base priority of “Normal” we can see that the operating system starts the majority of applications with equal importance in terms of processing time on the CPU. Because the CPU, or each core on the CPU, can only perform one task at a time, any application or process that is running with a base priority of “Above Normal” or “High” will receive a greater amount of CPU processing time. So the raising the base priority will affect how much CPU time the program will receive while it executes.
So why change the base priority of an application?
Changing the applications base priority is an easy way to boost the performance (or conversely restrict the system load) of a particular application. A typical example of a user raising application base priority would be a someone wishing to play a resource heavy game on their PC, raising the process base priority of the game would increase the user experience. Another example would be of a graphic artist who may reduce the base priority of a rendering program so normal desktop tasks could be performed while the render process runs in the background.
Setting the Application Base Priority
Changing an applications base priority to “Real-time” is not recommended as doing so allows the application to use all available CPU time. Should there be a problem with the application at during this time, it is extremely difficult to exit the process as it is using all available CPU time and therefore not allowing any other process to start. If you are going to use this setting, please do so with caution. If your computer has multiple processors or multiple cores, or is hyper-threaded, then you will also have the option “Set Affinity” of a process. This allows you to “tie” a process to a specific CPU. If setting an applications base priority to “Real-time” you should set the process affinity to a CPU(s) to try and avoid the situation mentioned above (usually a CPU rather than CPU0). There are a number of tools that can be used to view the application base priority setting, here I will describe two, Windows Vista Task Manager and Microsoft Sysinternals Process Explorer.
Task Manager
There are numerous ways to launch task manager:
- Click the Start button and type taskmgr in the Search box and hit return.
If User Account Control(UAC) is enabled, you will need to run Task Manager under an account that is an Administrator.
- Right-click on the taskbar and select Task Manager.
- Crtl+Alt+Del and select “Start Task Manager”.
- Click the Processes tab.
- Right-click on the name of the process that you want to change (in this case the calculator) the application base prioritiy.
- Select Set Base prioritiy and select the new base prioritiy level.
- You will be prompted with a warning, select “Change Base prioritiy” to set the application base prioritiy to the desired level.
- The application base prioritiy has now been changed.
Sysinternals Process Explorer
Process Explorer Microsoft Sysinternals Process Explorer can be downloaded from here.
- Once downloaded and extracted, run PROCEXP.EXE (the Process Explorer executable).
- From the View menu, select Columns. Click on the Process Performance tab and check Base prioritiy.
- Locate the “calc.exe” process (it will be a child process of the explorer.exe process). The Base prioritiy column will show a numeric value for the process’s running base prioritiy (refer to the table above).
- Right-click on the process and select Set Base prioritiy.

Notice that once the base prioritiy has been selected, the change is made immediately. This can be seen during the Process Explorer change, the calc.exe application base prioritiy has been changes from 8 (Normal) to 10 (Above Normal).
While this change is immediate, nothing lasts forever. Neither Task Manager or Process Explorer allows the user to save the new base prioritiy for the application, so, when the application exits and restarted; the base prioritiy is reset to its default value. So how can the base prioritiy be saved to avoid going through this process every time?
Starting Applications With A User Defined Application Base prioritiy
The Windows Vista Start command is a command line utility that allows you to start an application from the command line and modify, among other things, the application’s base prioritiy. This is particularly useful for creating a desktop icon for running a program at a give base prioritiy. To view a complete list of the available parameters for the Start command, just type Start /help. The Start utility has the following parameters:
"title" Title to display in window title bar. path Starting directory B Start application without creating a new window. The application has ^C handling ignored. Unless the application enables ^C processing, ^Break is the only way to interrupt the application I The new environment will be the original environment passed to the cmd.exe and not the current environment. MIN Start window minimized MAX Start window maximized SEPARATE Start 16-bit Windows program in separate memory space SHARED Start 16-bit Windows program in shared memory space LOW Start application in the IDLE base prioritiy class NORMAL Start application in the NORMAL base prioritiy class HIGH Start application in the HIGH base prioritiy class REALTIME Start application in the REALTIME base prioritiy class ABOVENORMAL Start application in the ABOVENORMAL base prioritiy class BELOWNORMAL Start application in the BELOWNORMAL base prioritiy class WAIT Start application and wait for it to terminate command/program If it is an internal cmd command or a batch file then the command processor is run with the /K switch to cmd.exe. This means that the window will remain after the command has been run. If it is not an internal cmd command or batch file then it is a program and will run as either a windowed application or a console application.
parameters These are the parameters passed to the command/program
So using this information, lets look at a previous example, running a game with increased base priority. The following command line will launch the solitaire game in “Above Normal” base priority. This command could be placed in a desktop shortcut or a batch file to avoid typing the command every time.
Start /ABOVENORMAL sol.exe
If you examine the running process for sol.exe using Task manager or Process Explorer you will see that the base priority is “Above Normal”.
Changing the Base Priority of Multiple Processes
From time to time you may be in the situation where you have multiple instances of a process running and you want to change the base priority of all of these processes at the same time. While using the methods discussed will work, the task would be time consuming. The following script uses a WMI call to reset the base priority of a number of processes at the same time. The script accepts two parameters, the executable of the process and the base priority required. So to reset the base priority of all running “cmd” windows to a HIGH priority, you would run the following command.
cscript modify_bp.vbs cmd.exe HIGH
(Running the script with the wrong number of parameters or with no parameters will display a help message.)
Please feel free to reuse all or part of this script, as you require.
' MODIFY_BP.VBS ' Script to modify the base prioity of a process. ' ' Marcus Walshe ' 18/11/2007 - Build6000.com
Const REAL_TIME = 128 Const HIGH = 256 Const ABOVE_NORMAL = 32768 Const NORMAL = 32 Const BELOW_NORMAL = 16384 Const LOW = 64 logo set objArgs = wscript.arguments If objargs.count < 2 Then helpmessage Else strProcess = objArgs(0) strBasePriority = UCase(objArgs(1)) end If
Select case strbasepriority Case "REAL_TIME" SetBasePriority strProcess,REAL_TIME Case "HIGH" SetBasePriority strProcess,HIGH Case "ABOVE_NORMAL" SetBasePriority strProcess,ABOVE_NORMAL Case "NORMAL" SetBasePriority strProcess,NORMAL Case "BELOW_NORMAL" SetBasePriority strProcess,BELOW_NORMAL Case "LOW" SetBasePriority strProcess,LOW Case Else helpmessage End select
Sub SetBasePriority(strProc,strBP) strComputer = "." Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcess = objWMI.ExecQuery _ ("Select * from Win32_Process Where Name = '" & strProc & "'") For Each objProcess in colProcess objProcess.SetPriority(strBP) i = i + 1 Next WScript.Echo i & " " & strProcess & " found, priority changed to " & strBasePriority & "." End sub
Sub helpmessage wscript.echo "Script Usage Instructions." & vbCrLf & "==========================" wscript.echo "This script will reset the base priority of a single or multiple processes" wscript.echo "based on the parameters provided.This script accepts two parameters:" wscript.echo VBCRLF & "Usage:" & vbTab & "cscript modify_bp.vbs " & VBCRLF WScript.Echo " - The is the executable name of the process you want to modify." WScript.Echo " - The is application prioity level that you want to set." &vbCrLf WScript.Echo "There are six base priority values: " WScript.Echo vbTab & "- REAL_TIME" & vbCrLf & vbTab & "- HIGH" WScript.Echo vbTab & "- ABOVE_NORMAL" & vbCrLf & vbTab & "- NORMAL" WScript.Echo vbTab & "- BELOW_NORMAL" & vbCrLf & vbTab & "- LOW" & vbCrLf WScript.Echo "EXAMPLE: Modify all running instances of Notepad to run at a base priority of HIGH." & vbCrLf WScript.Echo vbTab & "cscript modify_bp.vbs notepad.exe high" &vbcrlf WScript.quit End sub
Sub logo a=chrw(47) '/ c=chrw(95) '_ d=chrw(41) ') e=chrw(8195) ' space f=chrw(40) '( g=chrw(46) '. wscript.echo e+e+e+e+e+e+e+e+e+e+e+e+e+e+c+c+e+e+c+c+e+e+c+c wscript.echo e+a+e+e+e+g+a+c+a+a+c+e+e+a+e+e+d+a+e+e+d+a+e+e+d+e+e+e+c+e+e+e+c wscript.echo f+d+f+a+a+f+f+a+f+c+c+d+f+c+c+a+f+c+c+a+f+c+c+a+e+g+e+f+e+f+d+a+a+d WScript.Echo vbcrlf & " 2007 - Marcus Walshe" & vbcrlf End sub
No Comments.
 |