rbutcher has asked for the wisdom of the Perl Monks concerning the following question:

Greetings wise ones. I've managed to use Win32::Process::Info to get PID, process and thread priority info for a job that's running, but I can't see how I change the thread priority.. Am I looking at the wrong module ? thanks Rod
  • Comment on how to change process & thread priority on Win32 ?

Replies are listed 'Best First'.
Re: how to change process & thread priority on Win32 ?
by marto (Cardinal) on Nov 29, 2005 at 11:23 UTC
    Hi rbutcher,

    You should check out the SetPriorityClass method of Win32::Process.
    However, perhaps the script you are running is not as efficient as it could be, in which case it would be better to benchmark your script and find out what is going on.

    Hope this helps.

    Martin
      Thanks Martin, I can set the process priority OK with $obj-> SetPriorityClass($priority) where $priority = 32, 16384 etc. But I can't make it set Thread Priority to 1, 0, -1 etc. The doco. says THREAD_PRIORITY_HIGHEST, _IDLE, _LOWEST etc are "exported by default" - how do I use them ?
Re: how to change process & thread priority on Win32 ?
by zentara (Cardinal) on Nov 29, 2005 at 12:30 UTC