Limit use of the .NET.NET processor

Is there a way to disable CPU usage by a Windows service written in .NET, either inside the service code or externally. Setting the current thread to the lowest priority is not a parameter, but as soon as exceptions occur, the processor load increases, is this restriction possible?

+4
source share
3 answers

Nowadays, the memory bandwidth and processor cache use coincide with the coincidence of the problem with the processor time.

I don’t know which OS was saved ...

You can try using Thread.Sleep to sleep 50% of the time on the wall, randomly, but may work.

0
source

You need to study your application more closely. Why does this throw exceptions, and why do these exceptions use so much CPU?

+5
source

If you need to control CPU usage from outside the code, I would suggest using ThreadMaster http://threadmaster.tripod.com/ This is a bit outdated, but I've used it in the past and it was able to successfully solve my problem.

This is not ideal for a long-term solution, but it can be a good tool in some specific scenarios.

0
source

Source: https://habr.com/ru/post/1303693/


All Articles