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 Record CPU and Memory Usage Over Time in Windows?

Whenever the computer is lagging or some application is taking too long to respond, we usually fire up task manager and look under the Performance tab or under Processes to check on processor utilization or the amount of free memory available. The task manager is ideal for real-time analysis of CPU and memory utilization. It even displays a short history of CPU utilization in the form of a graph. You get a small time-window, about 30 seconds or so, depending on how large the viewing area is.

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.

Diagram 101: Different Types of Diagrams and When To Use Them

Diagrams are a great way to visualize information and convey meaning. The problem is that there’s too many different types of diagrams, so it can be hard to know which ones you should use in any given situation. To help you out, we’ve created this diagram that lays out the 7 most common types of diagrams and when they’re best used: