0

I've got a program that I want to limit the CPU usage of (yes, I've set the process priority and yes it's optimized). It always takes up 100% CPU power, it's CPU bound, and its workload will never finish.

I want to limit the usage of this process to 30% CPU usage, and the only way I've found to do this in a Windows application is to periodically have the program sleep. Here is the resulting CPU usage:

CPU Usage

The CPU usage shown above is over the course of one second. If you take the average value of that graph, it is ~32% (the target was 30). In fact, task manager reports the process is using between 25-35% CPU usage at any time.

My program may be run on notebooks, where the user may not want their fans to turn on for a background process. Also, many notebooks have a power-saving state for their CPUs, and I don't want my program to remove the CPU from its power-saving state. Will the constantly fluctuating CPU usage shown above turn on the fans of a notebook or remove it from its power saving state (the usage can be reduced to 15% or even less, but it still produces fluctuations from 100% to 0%).

Hennes
  • 65,804
  • 7
  • 115
  • 169
Byte11
  • 101

0 Answers0