in reply to Re: (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

free is cool- but.. it just shows you memory usage. There's a ton of stuff that uses little memory but will flirt excessively with the cpu.
  • Comment on Re^2: (OT) Run task only when resources have been free for x time

Replies are listed 'Best First'.
Re^3: (OT) Run task only when resources have been free for x time
by Illuminatus (Curate) on Nov 12, 2008 at 15:38 UTC
    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.