When you need to set CPU priority to prefer foreground apps you'll need to follow below procedure.
Every software running within the laptop either in the foreground or even in background will be given with certain time from your CPU. A lot more applications it needs to handle simultaneously, the fewer it allots time for every application. Each application takes a few resource.
Time could be distributed among all the applications or a selected application might get much more time resource since resulting in additional software to get a shorter time relatively. The app that will get the most of times from CPU functions rapidly whereas the low priority software will function slower.
If you want your foreground applications to run faster you need to set CPU priority to prefer foreground apps. You could follow below method.
Change CPU Priority to prefer foreground apps
In the Control Panel select System and Security and then click on “System” in System and Security window.
A whole new window will be opened where you should select the Advanced system settings on the left side panel, which opens another window System Properties.
At this moment click Advanced tab in System Properties window and click Settings under Performance.
A new window titled Performance Options opens up where you have to click on Advanced tab again and confirm Programs to ‘Adjust for best performance of programs’ and click on Apply and OK.
Generally, this selection is specified by default and therefore your Windows will immediately prefer foreground apps.