How to detect that my process is idle (not vcl app, not via Application.OnIdle)?

Comments

  1. Jacek Laskowski The Idle Process is not your process, so obtaining CPU usage for that doesn't match your requirement. In any event, at what point in execution is it going to do this check?. I'm guessing that since you say it's not a VCL app, it's a FMX app? You could have something respond to the TIdleMessage (which is I think what OnIdle does in FMX anyway)

    ReplyDelete
  2. This is REST server. I want, when is low CPU load, in a separate thread perform additional database maintenance tasks. This additional thread should stop/pause when the load of CPU is high.

    ReplyDelete
  3. The system already has mechanisms for this. You should not attempt to do this yourself. Just set the background thread's priority to be lower than the default.

    ReplyDelete

Post a Comment