Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags

Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Forums > Tutorials

Vista Tutorial - Processor Affinity

Comment
 
LinkBack Tutorial Tools Display Modes
<!-- google_ad_section_start -->Processor Affinity<!-- google_ad_section_end -->
Processor Affinity
How to Set the Processor Affinity for a Application in Vista
Published by Brink
04-12-2008

How to Set the Processor Affinity for a Application in Vista
Information
  By default, Vista set processes to run on all available processors (CPUs). If you have multiple processors or a multi-core processor, then you can use Process Affinity to control what processor(s) a application runs on. This will show you how to change the Processor Affinity for an application (process).

WHY:

Like setting the CPU Priority (See: How to Make a Program or Process Run with a Higher or Lower CPU Priority in Vista) , you can set the Processor Affinity to have a application (Ex: Anti-Spyware scan) to use only one CPU while you have another application (Ex: Internet Explorer) running on just the other CPU to allow maximum usage of the CPU assigned to each application.
NOTE
 
  • If the installed application supports Symmetric Multiprocessing (SMP) or HyperThreading (HT), then Vista will help automatically adjust the appliction's usage of each processor for the best performance. You will not gain much, if anything, from manually changing the processor affinity for these applications.
  • The Processor Affinity setting you make for a application will only last as long as the application is open. If you close the application or restart the computer, then the Processor Affinity will return to the default of using all CPUs automatically for that application.
Tip
 
COMMON PROBLEM:

You may discover that certain older applications, that are not multiprocessor (SMP or HT) aware, ran fine on systems with one single core CPU are now not running properly on multiple processors or a multi-core processor. For example, your application may suddenly begin maxing out the CPU usage at 100 percent, appearing to lock up.The Processor Affinity setting allows you to work around such problems by configuring older applications to use only one of the cores instead.
WARNING
  It is recommmended to not change the process affinity on Vista system file processes to avoid potential problems. Only change the process affinity on application processes instead to be safe.
RELATED LINKS:


Here's How:
1. Open Task Manager.
NOTE: Right click on the taskbar and click Task Manager, or press Ctrl+Shift+Esc.

2. Click on the Processes tab. (See screenshot below step 6)

3. Click on the Show processes from all users button.

4. Click on Continue in the UAC prompt.

5. Right click the process (application) you want to change the processor affinity on.

6. Click on Set Affinity.
task_manager.jpg
7. Check the CPU(s) that you want the process to run on. (See screenshot below step 8)
NOTE: If the process (application) does not support SMP or HT, then you may only want to have one CPU checked. If the process (application) does support SMP or HT, then you will most likely not gain any performance by not having all available CPUs checked. See the NOTE and COMMON PROBLEM sections at the top of the tutorial for more on this.

8. Click on OK.
Name:  Processor_Affinity.jpg
Views: 7045
Size:  29.6 KB
9. Close Task Manager when done.
NOTE: If you need to change the process affinity on another application, then just repeat these steps for it.
That's it,
Shawn
Published by
Brink's Avatar
Administrator

Join Date: Apr 2007
Location: Texas, USA
Posts: 23,772
Rep Power: 150
Brink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond repute

Tutorial Tools
Show Printable Version Show Printable Version
Email this Page Email this Page

Applies to
All Vista Versions
64 Bit & 32 Bit

Page copy protected against web site content infringement by Copyscape

Old 05-25-2008  
Grojor
Newbie


Join Date: May 2008
vista 32
 
Rep Power: 9
Grojor is on a distinguished road
  Grojor is offline

Re: Processor Affinity

Thanks for the info.
Will these affinities actually stick (meaning be the same next time I restart)? Same question would interest me for priorities as well...
Cheers
Grojor
My System SpecsSystem Spec
Old 05-25-2008  
Brink's Avatar
Brink
Administrator



Join Date: Apr 2007
Vista x64 Ultimate SP2
Texas, USA
 
Rep Power: 150
Brink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond repute
  Brink is online now

Re: Processor Affinity

Hi Grojor,

Welcome to Vista Forums.

Sorry, the settings will only last for as long as the application is open. Once closed, or computer restarted, they go back to the default settings.

I have heard that some programs that are multi-core or multi-CPU aware may have settings in the program itself that will remain though. I could not tell you of any off the top of my head though.

Shawn
My System SpecsSystem Spec
Old 05-25-2008  
Grojor
Newbie


Join Date: May 2008
vista 32
 
Rep Power: 9
Grojor is on a distinguished road
  Grojor is offline

Re: Processor Affinity

Pity, would have been great tool otherwise....

Thanks for your quick help, great forum here.

Grojor
My System SpecsSystem Spec
Old 09-20-2008  
bruhaha
Newbie


Join Date: Jul 2008
Vista Ultimate x64
 
Rep Power: 8
bruhaha is on a distinguished road
  bruhaha is offline

Re: Processor Affinity

CPU-Control is your software then if you are still interested
My System SpecsSystem Spec
Old 09-30-2008  
Carlos_will
Newbie


Join Date: Sep 2008
Windows Vista 64-bit ultimate
 
Rep Power: 6
Carlos_will is on a distinguished road
  Carlos_will is offline

Smile Re: Processor Affinity

Hello, I'm new and I'd just like to say your threads and guides are really good, very helpful. One question about setting the process affinity...

Can it be, for example set to high or real time everytime the application/.exe runs?

Thanks.
My System SpecsSystem Spec
Old 09-30-2008  
Brink's Avatar
Brink
Administrator



Join Date: Apr 2007
Vista x64 Ultimate SP2
Texas, USA
 
Rep Power: 150
Brink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond repute
  Brink is online now

Re: Processor Affinity

Hello Carlos,

Sorry but no, the settings will only last for as long as the application is open. Once closed, or the computer is restarted, they go back to the default settings.

I have heard that some programs that are multi-core or multi-CPU aware may have settings in the program itself that will remain set though. I could not tell you of any off the top of my head though.

Shawn
My System SpecsSystem Spec
Comment

Tags
affinity, cpu, performance & maintenance, processor

Tutorial Tools
Display Modes


Similar Threads
Tutorial Tutorial Starter Category Comments Last Post
Unable to set processor affinity for a game. VistaJames Vista Games 0 12-13-2007 05:25 AM
Set Affinity Norbert Vista General 8 05-30-2007 09:52 PM
Vista Taskmanager Processor Affinity error Bitbob Vista installation & setup 4 05-06-2007 06:59 AM
Affinity troy marrs Vista performance & maintenance 7 03-19-2007 01:20 PM
Set Affinity Troy Marrs Vista performance & maintenance 0 03-04-2007 05:55 PM


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
Tutorial powered by GARS 2.1.8m ©2005-2006