How to Assign Specific CPU Cores to an Application in Windows

Close up of AMD Ryzen CPU on a motherboard

Modern PCs have multiple CPU cores, and most of the time, Windows does a perfect job of choosing which CPU core should perform which job. However, you can enhance performance and solve certain issues when you assign a specific CPU core to an app, known as setting the processor “affinity.”

Tip: is your CPU being overworked? Learn how to fix 100% CPU usage in Windows.

Why Would You Set Processor Affinity?

Some common reasons you would want to set processor affinity in Windows include:

  • To improve performance: by setting the processor affinity for a process, you can ensure that it is running only on specific CPU cores, which can help improve its performance. For example, if a process relies heavily on a specific core, setting its processor affinity to that core can help it run more efficiently.
  • To avoid conflicts: in some cases, setting the processor affinity for a process can help avoid conflicts with other processes running on the system. For example, if two processes are trying to use the same core, setting the processor affinity for one of the processes can prevent conflict and improve the system’s overall performance.
  • To troubleshoot problems: sometimes setting the processor affinity for a process can help you troubleshoot problems related to CPU usage or performance. By isolating a process to specific cores, you can better understand how it affects the system and identify any potential issues.

If you’re using one of Intel’s new hybrid architecture CPUs, starting with their Alder Lake models, you may want to use manual processor affinity to ensure that an app runs on the correct type of core. Windows 10 users, in particular, may find that the CPU scheduler will assign apps that need high performance to an E-core (efficiency core) and less demanding apps to P-cores (performance cores).

If your system is running an up-to-date version of Windows 10 or any version of Windows 11, you’re unlikely to encounter any problems. However, some applications, especially older ones, may not function as expected on this new approach to desktop CPU architecture.

Tip: as part of your regular computer maintenance, an occasional CPU temperature check will help you extend your PC’s lifespan.

How to Set Processor Affinity in Windows

To set processor affinity in Windows, follow these steps:

Open the Task Manager by pressing Ctrl + Shift + Esc. Click on the Details tab to view a list of running processes.

Task Manager processes list

Right-click on the process for which you want to set the processor affinity, and select Set affinity from the context menu.

Set affinity for process in Task Manager

In the pop-up that appears, select the checkboxes next to the processors you want the process to run on.

Choose processor affinity in Task Manager

Click OK to save the changes, and close the window.

How to Set Process Priority in Windows

Additionally, if you want to set the process priority in Windows to force the system to assign CPU resources to a particular process over others, follow these instructions:

Open the Task Manager by pressing Ctrl + Shift + Esc, and click on the Details tab to view a list of running processes. Right-click on the process for which you want to set the priority, and select Set Priority from the context menu.

Set process priority in Task Manager

Select the desired priority level from the drop-down menu, and click OK to save your changes.

The available priority levels are:

  • Realtime: the process will be given the highest priority and the most CPU time.
  • High: the process will be given a high priority and allocated a significant amount of CPU time.
  • Above normal: the process will be given a higher than normal priority and allocated more CPU time than the normal processes.
  • Normal: the process will be prioritized and allocated the standard CPU time.
  • Below normal: the process will be given a lower-than-normal priority and allocated less CPU time than normal processes.
  • Low: the process will be given a low priority and allocated minimal CPU time.

Good to know: make sure your computer CPU is kept at optimal temperature by investing in a CPU cooler.

When to Be Cautious with Processor Affinity

Manually assigning processor affinity can carry several risks. Some of these potential risks include:

  • Reduced performance: incorrectly setting the processor affinity for a process can result in reduced performance. For example, if you assign a process to a CPU core that cannot handle its workload, the process may run more slowly or become unresponsive.
  • System instability: setting the processor affinity for a process can affect the overall performance and stability of the system. If you assign a process to a core that is already heavily utilized, it can cause the system to become unstable or crash.
  • Reduced flexibility: manually assigning the processor affinity can limit the system’s flexibility. For example, if you set the processor affinity for a process, it will only be able to run on the assigned cores, even if other cores become available. This can make it difficult to adjust to changing workloads or respond to system failures.
  • Security vulnerabilities: in some cases, manually assigning the processor affinity can create security vulnerabilities. For example, setting the processor affinity for a malicious process can prevent security software from detecting or mitigating the threat.

Overall, manually assigning processor affinity can be a useful tool for optimizing the performance of your system. Still, it is important to use it carefully and clearly understand the potential risks.

Tip: buying a new CPU? Our CPU buying guide illustrates what to look for in a desktop processor.

Frequently Asked Questions

What is Processor Affinity in Windows?

The CPU, or processor affinity, setting in Windows enables you to bind a process to a specific physical core on your CPU so that it will only run on that specific core. This can help you utilize the best-performing cores of your CPU for a particularly demanding process, limit CPU usage for an application, or diagnose issues affecting the performance of multiple cores.

What Is CPU Priority in Windows?

CPU priority in Windows is a scheduling system used to prioritize the various tasks or requests being sent to the CPU at any point in time. Windows determines which processes are more critical than others so that it can assign CPU resources preferentially to those processes over others.

Can you assign all CPU cores in Windows to one app?

Yes, you can assign all CPU cores in Windows to an app by setting the processor affinity for the app to include all available cores. However, assigning all CPU cores to an app may impact your system’s performance and stability.

Which apps may benefit most from core affinity assignment?

Apps like Adobe Premiere Pro, Blender, Maya, 3ds Max, MATLAB COMSOL, ANSYS, and DaVinci Resolve can be highly CPU-intensive and may benefit from being assigned to specific CPU cores.

When does affinity reset?

Manually assigned processor affinity does not reset automatically. Once you set the processor affinity for a process, it will remain assigned to the selected processors until you change it or the process ends.

However, there are some situations where the processor affinity for a process may be reset. For example, if you restart your computer, or the process is terminated and restarted, the processor affinity for the process will be reset to the default value.

Image credit: Unsplash. All screenshots by Tanveer Singh.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Tanveer Singh

After a 7-year corporate stint, Tanveer found his love for writing and tech too much to resist. An MBA in Marketing and the owner of a PC building business, he writes on PC hardware, technology, video games, and Windows. When not scouring the web for ideas, he can be found building PCs, watching anime, or playing Smash Karts on his RTX 3080 (sigh).

Leave a Reply

Your email address will not be published. Required fields are marked *