How To Set Processor Affinity To An Application In Windows 7,Vista,XP

In Windows XP, Windows Vista, and Windows 7 applications by default run on all available cores of the processor. If you have a dual or quad core processor, then you can set affinity to an application to control which core of the processor an application can use, in this way you can assign one application or a program to use only one processor while other application can run on other processor. Although you cannot set priority to system services but you can set affinity to applications like Google Chrome, Firefox or any Anti-Virus, in this way you can achieve a good overall performance.

Windows XP

Press Ctrl+Alt+Delete to open Windows Task Manager, and go to the Processes tab and look up for the process name that you want to set the affinity for. If you don’t know which process is associated with which application, go to the Applications tab and right-click on the application name and select Go To Process.

goto processs

In the Processes tab the specified process will be highlighted. Now right-click on the process and select Set Affinity.

set affinity

In the Processor Affinity dialog, you will see 32 check box options, only the number of cores in your processors will be available to set affinity to.core


In a single dual core system you’ll see CPU 0 and CPU 1, from here you can check or uncheck the core you want the application to use.

Windows Vista and Windows 7

Press Ctrl+Shift+Esc to open Windows Task Manager.

vista task manager

On the Processes tab, at the bottom click on Show processes from all users button.

Right click the process (application) whose processor affinity you want to change and choose Set Affinity. Now Check the CPU(s) that you want the process (application) to run on and click OK

set affinity

Note

  • It is recommended NOT TO change the Process Affinity for System Processes.
  • The processor affinity setting lasts as long as an application is open, when you close the application or restart the computer, the affinity returns to the default.

Advertisement
  • tamxir (Bruce Brown)

    I have found this very useful when running say a full system Virus check and a spyware scan with Spybot Search & Destroy for example on my weekly ‘maintenance day’. A lot of this kind of software is unaware of multiple core processors so they make good candidates to use this technique.

    Some of the scanning applications tend to slow you down if all run together, but by assigning each to a seperate core (Quad Core machine here) I hardly even notice them running as I have the other two processor cores available for anything else I’m doing. (Each core running 100% meaning 2 x 25% running scans and therefore 50% of system free for all else.)

    There is an interesting article from a few years back that went into depth on this topic.

    http://www.tomshardware.com/reviews/bang-dual-processing-buck,815.html

    Also some software to make the processor affinities ‘stick’.

    Dowload link – http://images.tomshardware.com/2004/05/28/getting_more_bang_out_of_your_dual_processing_buck/taskassign.zip – BUT read the article first.

    It does work with Vista 32bit, but be cautious and know what you are doing before processor assigning willy-nilly :)

    Regards
    Bruce Brown

  • http://www.addictivetips.com Asad

    Thank you so much Bruce brown for sharing these links with us, i wrote this post without these calculations so that a beginner user may understand the benefit of setting affinity easily .. keep reading on our other posts !

  • Kris

    I know Im bringing back an dead thread but:

    “Each core running 100% meaning 2 x 25% running scans and therefore 50% of system free for all else.)”

    @Tamxir:

    Your math is wrong, if each core (assuming 4 cores) is running 25%, the system is still only running at 25% of total.

    If a core is running at 100% that is only 25% of the total, so 25% of 25% is only 1/16th of system processing overhead.

    So, 2 cores running at 25% represent only 1/8th.

    • http://www.addicitivetips.com Nakodari

      Thanks for the comment Kris. It was quite knowledgeable. Btw no thread at AddictiveTips is dead, we read all comments daily. :)

  • VulcanTourist

    tamxir’s reasoning is missing the rest of the system context, which is a common mistake: the CPU is not the only component in a system, and other bottlenecks beside processor utilization can easily be created. In tamxir’s described situation, with “scanning” utilities which are scanning files, the real bottleneck is actually the disk I/O channel(s), not the CPU; the CPU would be left spinning its wheels most of the time while waiting for the file system to deliver the next file to it. Malware scanning is an I/O intensive operation, so tamxir’s prescribed solution isn’t a good solution for the actual bottleneck at all. In typical placebo-effect fashion, though, he’s apparently deluded himself into thinking it actually makes a difference because he expects and believes it must be making a difference. The only sort of thing that would improve performance in that situation would be to have more than one physical disk, each disk attached to its own separate I/O channel (either SATA disks or two PATA drives as “master”), carefully restrict the scanning activities of the separate programs so that they are each scanning separate drives at the same time, and then schedule a separate following run of each which would swap the drives being scanned. Having done that and eliminated the big bottleneck, there might then be some small benefit to be had from limiting each process to one core and leaving two others free, but probably not much.

  • south

    When I try to change a program´s affinity, a message box appears saying “Access Denied”. Im the administrator, how can I not have access? OP is Windows 7.

    • Trevor

      same for me, some I can get access, but others not.
      I run an older program “VRC (virtual RC)” and found on XP that it ran much smoother on one processor. Since moving to Windows 7 it is quite smooth on dual processor but not as smooth as it was on one processor on XP, however I cant try on Win 7 As I get access denied.

      Trevor

      • BlueOreo

        I'm in the same situation with a piece of screen capture software called FRAPS. It won't let me set my processor affinity in Windows 7. Anyone have a fix for this?

  • south

    When I try to change a program´s affinity, a message box appears saying “Access Denied”. Im the administrator, how can I not have access? OP is Windows 7.

  • south

    When I try to change a program´s affinity, a message box appears saying “Access Denied”. Im the administrator, how can I not have access? OP is Windows 7.

  • someone

    hi,

    to fix this start task maneger
    go to the tab prosecces
    than under the prosecces list thare is a button with show all processes
    -this will, well, show all processes of the computer curent runing-

    this worked for me on windows 7 hopes it works for you (and who ever reeds this)

    ps. I got a dutch installed windows 7 so name wont be right

    pps. (please spread this). if you had a problem and found a selution. put it on the forum. so other poeple can use it to. I see lots of times poeple with the same problems. as soon as that have the fix thay usaly say:”I found a fix, thanks guys.” and nothing more.
    this realy irritates me.

    thanks

    • baalzor

      ok…so i had problem in certain game and one guy replied to my topic, saying he fixed the problem by setting the CPU affinities on dual core to one of the processors on that application of the game itself.
      my question is…how to make game using one core always so i dont experience crappy bug caused by dual core and so i dont need to set affinities every time i start the game?
      thank you very much guys.

  • Mark Paquette

    I’ve used a program called ICEAffinity for several years. It’s not perfectly what I want, which is for the affinity to stick, however to accomplish what Baalzor wants it’s fine – however, you have to create new shortcuts referencing IceAffinity.exe which in turn runs the executable you specifiy using the processors you specify.

  • Fraser

    Hey
    Im trying to set the affinity for system shock 2 on window 7 but when ever i try i am told that access is denied…anyone have any idea why?
    also the the process listed has a *32 next to it..i assume that is to do with this beinga 64 bit system and it being made for a 32bit system…but thats just a guess

    any help would be appreciated

    • SD

      Hi,

      if you have started a program in administrator mode (or it starts itself in this mode), you can’t set the CPU affinity by just using the task manager, since the default task manager only allows to modify user processes (That’s why you get the access denied error). You have to click in the task manager at the bottom on: “Show processes from all users”. This puts the task manager in administrator mode and you can set the CPU affinity even for processes running in admin/compatibility mode.

      Hope that helps.

      SD

  • dave

    http://www.activeplus.com/us/freeware/RunFirst

    Will allow you to play older games such as the Thief series 1,2 and 3 since they do not like multi-core systems. I could not play Thief Deadly Shadows since my system locked up when i alt-tabbed out to select affinity manually. With this i am able to play it again.

    I thought i would put this out there since i am still looking for more alternatives as well.

  • Patrice Boivin

    Note that the affinity parameter is in hexadecimal, in case you’re trying to pin your app to CPUs 2 and 3, use C instead of a number.

    (hexadecimal numbers range from 0-F, which in decimal is 0-15)