rovf has asked for the wisdom of the Perl Monks concerning the following question:
I would like to lower the priority of my Perl process on Windows. In Re: Changing Windows Process Priority I found a solution to a very similar problem. From http://sourceware.org/pthreads-win32/manual/PortabilityIssues.html I conclude that I need to set the priority to BELOW_NORMAL_PRIORITY_CLASS, so my solution looks like this:
This doesn't compile, however, because BELOW_NORMAL_PRIORITY_CLASS is not defined in Win32::Process (and indeed, the perldocs don't mention this constant). How can I do this properly?use Win32::Process; my $currentProcess; if (Win32::Process::Open($currentProcess, Win32::Process::GetCurrentPr +ocessID(), 0)) { $currentProcess->SetPriorityClass(BELOW_NORMAL_PRIORITY_CLASS); } else { warn "Can not find myself ($^E)\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to lower my own priority on Windows?
by Anonymous Monk on Oct 05, 2009 at 12:04 UTC | |
by rovf (Priest) on Oct 05, 2009 at 12:29 UTC | |
by Anonymous Monk on Oct 05, 2009 at 13:26 UTC | |
|
Re: How to lower my own priority on Windows?
by Anonymous Monk on Oct 05, 2009 at 13:20 UTC | |
|
Re: How to lower my own priority on Windows?
by lostjimmy (Chaplain) on Oct 05, 2009 at 13:23 UTC |