Start an Application Assigned to a Specific CPU in Windows Vista

by Prasanna Vignesh 5. May 2007 20:20


Windows Vista has an option that lets you start an application and set the CPU affinity, which assigns the application to run on a specific CPU in a dual-core system.

To start an application you have to pass the affinity flag to the start utility in the command prompt. For instance, if you wanted to start notepad assigned to CPU, you could use the following command:

c:\windows\system32\cmd.exe /C start /affinity 1 notepad.exe

You can see in task manager that the process is only assigned to CPU 0


To start a process on CPU 0, use the following command switch:

/affinity 1

For CPU 1, use this switch:

/affinity 2

You can use a number up to the number of CPU cores or CPUs in your system. The affinity is essentially CPU core # + 1, so /affinity 5 would use CPU 4.

You can almost modify the shortcut for an item to make it run on the specific CPU, by just prepending the full "c:\windows\system32\cmd.exe /C start /affinity 1 " onto the shortcut target. The only drawback to this approach is that the command prompt window will briefly flash on the screen.

Note: For more Windows Vista Tips, Tricks & Tweaks.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Tags:

Windows Vista

Comments

12/21/2009 7:56:07 AM #

web application development

Thanks for the great advices mate. However I would say that Windows Vista is not the best option. Maybe I am too traditional, but Windows XP was always the best option for me. But the world moves on, and I will try to keep Vista on my pc, so thanks for those useful tips. I will be following your blog in the future and waiting for other great posts.

web application development United States |

12/21/2009 2:25:24 PM #

Aloe Vera Gel

Admiring the time and effort you put into your blog and detailed information you offer! I will bookmark your blog and have my children check up here often. Thumbs up!

Aloe Vera Gel United States |

Comments are closed

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen, Modified by Prasanna Vignesh.



About Me

Prasanna Vignesh Prasanna Vignesh
Mobile application developer at ZSL. More...



RecentPosts

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar