View Single Post
Old 04-17-14, 05:28 PM   #34
Pisces
Silent Hunter
 
Join Date: Dec 2004
Location: AN9771
Posts: 4,892
Downloads: 300
Uploads: 0
Default

I just found a page that explains how you can start a program with affinity assigned to a specific core, through a command line. So if this is entered into a .bat file or shortcut then it would be easily executed (from desktop or something) and not require manual assigned affinity through taskmanager.

http://www.techrepublic.com/blog/win...formance-edge/

[EDIT] T̶h̶e̶ ̶a̶b̶o̶v̶e̶ ̶l̶i̶n̶k̶ ̶s̶e̶e̶m̶s̶ ̶d̶e̶a̶d̶, but I found the important part again: (quoted in the spoiler)
 
From a shortcut

Now if you find that running an application on a specific CPU core works well, you might want to use it again in the future. If so, chances are that you won't want to have to go through the Task Manager each time. Fortunately you can create a shortcut to launch an application with a specific affinity setting.

For example, to launch Disk Defragmenter so that it runs only on CPU 0, you would create a shortcut with the following command line:
Quote:
C:\Windows\System32\cmd.exe /C start /affinity 1 dfrgui.exe
To launch Disk Defragmenter on CPU 1, you would create a shortcut with the following command line:

Quote:
C:\Windows\System32\cmd.exe /C start /affinity 2 dfrgui.exe
The number that follows the start /affinity command is called the affinity mask and is defined as a hexadecimal number. However, the CPU core number can be calculated more easily using binary numbers. For instance, the command
Quote:
C:\Windows\System32\cmd.exe /C start /affinity 3 dfrgui.exe
will launch Disk Defragmenter on both CPU 0 and CPU 1. If you convert 3 into a binary number you will get 0011. Under the affinity mask system, processors are numbered from the right to left beginning with 0 and since there are 1's in the first two places, this indicates CPU 0 and CPU 1.

Suppose you have a Quad core processor. If so and you use an affinity mask of 4, that will convert into binary 0100, which indicates CPU 2. If you use an affinity mask of 9, that will convert into binary 1001, which indicates CPU 0 and CPU 3.

For more information on the start /affinity command, open a Command Prompt window and type the command
start /?

Last edited by Pisces; 12-12-15 at 06:16 AM. Reason: added spoiler with content because of (not anymore) dead link
Pisces is offline   Reply With Quote