How to Assign Specific CPU Cores to an Application in Windows

Windows Affinity Use Featured

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

Why Would You Set Processor Affinity?

There are several reasons you would want to set processor affinity in Windows. Some common reasons include:

  • To improve performance: by setting the processor affinity for a process, you can ensure that it is only running on specific processors, which can help improve its performance. For example, if a process relies heavily on a specific processor, setting its processor affinity to that processor 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 processor, 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 processors, you can better understand how it affects the system and identify any potential issues.
Windows Affinity Intel Core
Image source: Unsplash

If you’re using one of Intel’s new hybrid 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 may assign apps that need high performance to an E-core or vice versa.

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 computer 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

To set processor affinity in Windows, follow these steps:

  1. Open the Task Manager by pressing Ctrl + Alt + Delete and clicking on the “Task Manager” button.
  2. In the Task Manager, click on the “Details” tab to view a list of running processes.
Windows Affinity Taskmanager
  1. Right-click on the process for which you want to set the processor affinity and select “Set affinity” from the context menu.
Windows Affinity Set
  1. In the pop-up that appears, select the checkboxes next to the processors you want the process to run on.
Windows Affinity Choose
  1. Click the “OK” button to save your progress and close the window. The change will take effect instantly.

How to Set Process Priority

To set the process priority in Windows, follow these steps:

  1. Open the Task Manager.
  2. Click on the “Details” tab to view a list of running processes.
Windows Affinity Taskmanager
  1. Right-click on the process for which you want to set the priority and select “Set Priority” from the context menu.
Windows Affinity Priority
  1. Select the desired priority level from the drop-down menu.
  2. Click the “OK” button to save your changes and close the “Set Priority” window.

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 will be allocated a significant amount of CPU time.
  • Above normal: the process will be given a higher than normal priority and will be allocated more CPU time than 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 will be allocated less CPU time than normal processes.
  • Low: the process will be given a low priority and will be allocated minimal CPU time.

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

When to Be Cautious with Processor Affinity

Manually assigning processor affinity can carry several risks. Some of the potential risks of manually assigning processor affinity 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 processor 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 processor that is already heavily utilized, it can cause the system to become unstable or crash.
  • Reduced flexibility: manually assigning 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 processors, even if other processors become available. This can make it difficult to adjust to changing workloads or respond to system failures.
  • Security vulnerabilities: in some cases, manually assigning 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: does your CPU usage keep reaching 100%? We show you how to fix it.

Frequently Asked Questions

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, or 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 Sydney Butler.

Sydney Butler
Sydney Butler

Sydney Butler is a technology writer with a background in Psychology who has written for a wide variety of technology outlets including How-To-Geek, Online Tech Tips, Helpdesk Geek, 9to5Mac, 9to5Google, and many more. He has 25 years of technology troubleshooting experience as a technician and user-education practitioner.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox