in reply to Re^2: (OT) Run task only when resources have been free for x time
in thread (OT) Run task only when resources have been free for x time

I mentioned free because you did not indicate which resources were important to you. If cpu is the overriding factor, then Sys::Load is probably your best bet. Load average is the best generalized mechanism for gauging CPU utilization. When this number exceeds 1, it means there are more threads/processes waiting to run than are able to. On a single CPU system, if all 3 average values are greater than 1, then the system is experiencing sustained load.

It might be enough to see all 3 load values be less than 1. Of course, this is all backward-looking. It is a little trickier to start your 'hog' process, and then have something more important decide it needs to run.

  • Comment on Re^3: (OT) Run task only when resources have been free for x time