Monitoring and Optimizing Apps on Dual-Core and Multiprocessor Systems
- Setting Process Priority
- Setting Affinity
- Windows System Resource Manager
- Conclusions
Multiprocessor computers have been around for quite a while, but dual-core processors are a relatively new offering. Both Intel and AMD dual-core processors are showing up in consumer-level servers, desktop systems, and laptops. A dual-core processor is essentially a single CPU chip that’s actually two processors. Since it’s really a single plug-in chip, though, you see only a single CPU chip plugged in when looking at the motherboard.
If you’re using a Windows 2000, XP Professional, or Windows Server operating system, you can open the Performance tab in Windows Task Manager (as shown in Figure 1) to see that multiple processors are recognized by the operating systems. Notice that the CPU Usage History has two windows; each window represents a processor (CPU).
Figure 1 Performance tab showing two processors.
If you have a system with two dual-core processors, the CPU Usage History will have four windows, one for each processor, as shown in Figure 2.
Figure 2 Performance tab showing four processors.
Setting Process Priority
Whether you have multiple physical processors or dual-core processors, the operating system treats them as separate processors. Multitasking operating systems receive processing requests from applications. These requests are known as threads. The applications run as processes and the operating system schedules those processes. You can see the running processes by clicking the Processes tab. You can affect how applications run by making changes to the processes listed there. The adjustments that you can make include changing the base priority at which a process spawns threads, as well as setting the processor affinity of the process. Both types of adjustments affect application performance.
The Windows 32-bit operating systems schedule threads using 32 priority levels, numbered from 0 to 31. The highest-numbered thread is processed first. As threads wait to be processed, their priority levels are increased. The base application priority determines the priority level at which threads begin. As a Windows administrator, you can adjust the base priority of a process to a variety of settings. The following table shows the priority levels for each of these definable settings.
Setting |
Priority Level |
Realtime |
24 |
High |
13 |
AboveNormal |
9 |
Normal |
8 |
BelowNormal |
7 |
Low |
4 |
If you right-click a process on the Task Manager’s Processes tab and select Set Priority, you’ll see all six priority options. You can set the Realtime priority only when you’re logged onto a system with administrative rights.
When might you want to change the priority of a running process? If you have a an application that you expect to run for a long time, but you want to minimize the impact of that application on the computer’s performance while you’re using it, you can set the less important process to run at a BelowNormal or Low priority level. Conversely, if you have a critical application that you want to receive processing time over all other applications on the system, you can set the priority level to AboveNormal or High.
If you want a particular Windows application to always start with a base priority other than normal, you can use the Start command in a batch file to always launch that application at a higher priority. For example, if you wanted to run an application named PriorityOne at a high priority, you could create a batch file using the start command:
start /high c:\priorityone.exe
This command could be used to start the application at a high priority.