Set priority on an application in c #

0

Hi, I was trying to lower the priority of my application in order to limit the consumption of resources but at the moment I do not know very well if lowering the priority could avoid it. As I did not work, I thought of putting it as a thread and thus limit the execution of it or lower the priority, but I am not sure if it is the right way. What I want is that my application is limited in the consumption of cpu, resources, etc. ..

My question if my application consumes a lot can limit the consumption of resources or cpu to limit it or some way to avoid it?

    
asked by Sir Jack 01.06.2017 в 14:46
source

1 answer

2

The answer to if my application consumes a lot can limit the consumption of resources or cpu to limit it or some way to avoid it? is No . The operating system is responsible for that task. As you say, the best way to deal with CPU consumption is to change the priority of the application as follows:

Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal;

    
answered by 01.06.2017 в 14:56