Friday, July 17, 2009

Using Imagecfg.exe To Instruct Programs to Run on A Specific CPU core in Windows

If you own a multicore CPU (e.g. Intel's Dual Core, Core 2 Duo, Quad Core etc), you may wish to dedicate a specific CPU core just for running some programs. In some instances, some programs simply cannot run on multicore CPUs and would need to be assign to one specific CPU core. An example of such a program was mentioned in my earlier Regcleaner posting.

Say for instance you own a Dual Core CPU, your PC's OS would detect the presence of 2 CPUs in your box as CPU0 (0x1) and CPU1(0x2).

To instruct Regcleaner to run on a specific CPU core (say CPU0), you can use the imagecfg.exe program and execute the command like so:

    imagecfg -a 0x1 c:\path\to\Regcleaner.exe

In tech-speak, what we have done is changing the program's (in this case Regcleaner) CPU affinity. If you prefer to assign Regcleaner to the second CPU core instead, use

    imagecfg -a 0x2 c:\path\to\Regcleaner.exe

That's it! Enjoy.

No comments:

Post a Comment