Set affinity for a program via Task Manager in Windows XP

Posted on September 18, 2008 at 5:39 am

If you have a computer with more than one processor, you can set Windows processes to use different processors in order to make a program run faster or to isolate a particular program that uses a lot of processing power. This is called processor affinity.

For example, let’s say you like to rip DVDs, convert the DVD to iPod, PSP, AVI, etc, and re-burn them. That’s probably going to eat a lot of your CPU cycles. So if you have more than one processor, you can dedicate one processor to just those tasks and leave the other one for normal computer activity, such as browsing the net or working with Office documents, etc.

How to set affinity in XP

In order to set affinity, you have to go to the Processes tab in the Windows Task Manager. If you are not familiar with the Task Manager, I suggest you read my three part article that goes through all aspect of how to use the Task Manager.

Now go to the Processes tab and find the process name that you want to set the affinity for. Note that all of the names are actually the executable names, not the name of the application, though lots of time they are very similar. If you can’t figure out which process is associated with which application, go to the Applications tab first and right-click on the application and choose Go To Process.

go to process

This will take you to the Processes tab and highlight the associated process for you. Easy enough. Now right-click on the process and choose Set Affinity.

set affinity

You’ll now get the Processor Affinity dialog, which will have 32 check box options, all grayed out except for the number of CPU’s on your computer.

processor affinity

Note that in Windows XP, if you have a dual core processor, it will look like there are two processors in Windows, however there really is only one processor and TWO cores. So in a single dual core system you’ll see CPU 0 and CPU 1. The first one is the physical process and the second one is the virtual processor.

In a computer that has two dual core processors, you’ll have the screen like above, CPU 0, CPU 1, CPU 2, and CPU 3. CPU 0 and CPU 1 are both the physical processors and CPU 2 and CPU 3 are the virtual processors.

Note that setting processor affinity is only useful for programs that actually support hyper-threading. If you try this on a non hyper-threading process, it won’t make any difference and could actually slow your computer down. Lots of newer games and some apps support hyper-threading, but you’ll have to read the documentation to really know.

Another issue you might see is when running older applications on a dual core machine. Older applications will actually run slower and may start using up 100% of the CPU. You can go into the Processor Affinity dialog and un-check one of the cores so that the program uses only a single core.

cpu affinity xp

Having any issues or problems? Post a comment and I’ll try to help you out!

» Filed Under Windows XP

Related Posts

Comments

6 Responses to “Set affinity for a program via Task Manager in Windows XP”

  1. SHUBH said on :

    HI, you just now mentioned that older applications (mostly) don’t support hyper-threading, but again below that you suggest I can set affinity of such applications restricted to one core…. how???? i am confused. one more thing….

    Should i restrict an application to a physical processor or to a virtual one, or either will work? pls if u can then reply via mail…..thanx a lot. I went thrugh all your posts related to task manager. great work.


  2. Blake said on :

    When I right-clicked on one of the processes in the Processes tab, a box pops up saying “The operation could not be completed. Access is denied.”


  3. Hal said on :

    How do you know if a program supports multi-threading or not? Can I set affinity the same way in Windows 7? And if I have a Quad core machine, how many CPUs will I see?


  4. Gustavo said on :

    How do you set permanently the affinity in windows XP to an app. If I set the affinity just like you do, when I close the app the configuration is lost. Is any way to do the change permanently?

    In Vista I can use the parameter affinity in the start command but in XP I can’t. Thanks!


  5. gianluca said on :

    Hi, I wanted to ask how to dedicate a cpu completely to a single process. I mean: when I set an affinity all the others processes will still use a second cpu? Is it possible? Maybe I’m wrong and I simply do not understand.

    Thank you
    Bye


  6. George said on :

    I have the same problem as Blake. “When I right-clicked on one of the processes in the Processes tab, a box pops up saying “The operation could not be completed. Access is denied.”” I hope you give me by mailing me an answer. Thank you!


Please post your comments/suggestions!