Skip to main content

Set CPU Affinity: Improve multitasking

What is CPU Affinity?

Simply stated, CPU affinity is the tendency for a process to run on a given CPU as long as possible without being moved to some other processor. When we run an application on a dual-core processor, usually both the cores get used depending on whether the application is multi threaded or not and how efficiently Windows distributes the threads between the 2 cores.

Its possible to take the control on your hands by assigning different applications to different cores so that they run only on the assigned core. By doing this you can assign one application to one core and another application to the other core, so that you can multitask and none of the 2 application interfere with each other. This comes handy when you want to say, rip a DVD and play a game at the same time. By assigning both the DVD ripping program and the game to seperate cores you can play your game with ease without having to worry about game lagging or low FPS.

Changing CPU affinity is easy.

1. First launch the program you want to change CPU affinity of.
2. Open Task Manager and then click on the Process tab.
3. Locate the application from the list and right-click, and then click Set Affinity
4. Now uncheck the corresponding box of whichever CPU you don't want the program to run on.

This method can be a bit difficult to assign CPU affinity to games because you have to run the game for the process to appear on the task manager's list, and once the game loads, the task manager disappears. There is workaround to this problem. For this download a small utilty called imagecfg.exe (24KB only)

1. First copy this tool to the game folder.
2. Now make a backup of the executable file of the game. Just copy it to some safe location. This is important.
3. Open command prompt and go to your game folder and type

imagecfg -a 0x1 game.exe (suppose the game file is game.exe)

Done. This will patch the game file so that it will run always on Core1. To assign it to core 2 type:

imagecfg -a 0x2 game.exe

The following image shows a DivX encoder running without assigning CPU. Watch both cores in action.





This time the same encoder running after assigning it to Core1. See Core2 lying idle.




To set CPU affinity permanently, use a program called Process Lasso.

Related: Automatically increase priority of active applications

Comments

  1. This is very useful information and has saved me from having a frozen computer many times - my only problem is to find a way to set the affinity permanently.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to Schedule Changes to Your Facebook Page Cover Photo

Facebook’s current layout, the so called Timeline, features a prominent, large cover photo that some people are using in a lot of different creative ways. Timeline is also available for Facebook Pages that people can use to promote their website or business or event. Although you can change the cover photo as often as you like, it’s meant to be static – something which you design and leave it for at least a few weeks or months like a redesigned website. However, there are times when you may want to change the cover photo frequently and periodically to match event dates or some special promotion that you are running or plan to run. So, here is how you can do that.

69 alternatives to the default Facebook profile picture

If you have changed the default Facebook profile picture and uploaded your own, it’s fine. But if not, then why not replace that boring picture of the guy with a wisp of hair sticking out of his head with something different and funny?

How to remove watermark from an image or picture

A watermark is any recognizable text, logo or pattern that appears over an image to identify the owner of the image and generally used to prevent unauthorized reuse of the image. Watermarks are usually transparent and can be difficult to remove. The difficulty or ease of removal depends on the content of the image and the position, color, size etc of the watermark.