CPU throttling in C++

后端 未结 5 838
半阙折子戏
半阙折子戏 2021-02-06 20:53

I was just wondering if there is an elegant way to set the maximum CPU load for a particular thread doing intensive calculations.

Right now I have located the most tim

5条回答
  •  天命终不由人
    2021-02-06 21:33

    The problem is it's not normal to want to leave the CPU idle while you have work to do. Normally you set a background task to IDLE priority, and let the OS handle scheduling it all the CPU time that isn't used by interactive tasks.

    It sound to me like the problem is the watchdog process.

    If your background task is CPU-bound then you want it to take all the unused CPU time for its task.

    Maybe you should look at fixing the watchdog program?

提交回复
热议问题