Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've created an exe using c# and run it but it is running on Below Normal Priority. I want it to run on Normal priority. But using visual studio.

Is any way possible through visual studio settings.

What I have tried:

Process proc = GetCurrentProcess(); proc.PriorityClass = ProcessPriorityClass.Normal.
But this effecting my exe work.
Posted
Updated 19-Jul-16 23:12pm

1 solution

Probably, you can't.
A quick look at the documentation: ThreadPriority Enumeration (System.Threading)[^]
says:
The operating system can also adjust the thread priority dynamically as the user interface's focus is moved between the foreground and the background.
So if you set the process priority to "Normal" (the default) windows can "downgrade" it to "Below Normal" when it doesn't have the input focus to maintain the user experience.

It may be that you can set it to "Above Normal" to get some improvement, but you risk "locking out" the UI for your existing app.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900