in reply to CPU usage Windows OP

I don't know about Windows, under *NIX I'd set the process priority (otherwise also called the nice-level) and let the operating system scheduler handle the rest. That's what it's there for after all, and a hand-rolled solution involving sleep is almost certain to be inferior in every respect.


All dogma is stupid.

Replies are listed 'Best First'.
Re^2: CPU usage Windows OP
by holli (Abbot) on Mar 21, 2006 at 12:51 UTC
    Seconded. For Win32 I suggest using Win32::Process which has a a SetPriorityClass($priority) method.


    holli, /regexed monk/
      Thanks. ppm presents three options for me:
      1. Win32-Process-Info [1.006] Get information on arbitrary process +es in Wi~ 2. Win32-Process-Memory [0.20] read and write memory of other windo +ws proce~ 3. Win32-Process-Perf [1.02] Performance counter for processes
      I am assuming that it is the first of these that are required.
        As you're using ppm I assume you have the Activestate distribution. You therefore already have Win32::Process installed and that is presumably why ppm didn't return any results.

        No. Check the link