[ale] perl nice'ness
fletch at phydeaux.org
fletch at phydeaux.org
Mon Oct 8 12:35:16 EDT 2007
> On Sun, 2007-10-07 at 01:48 -0400, List wrote:
>> Jim Popovitch wrote:
>> > Is there a way to make perl scripts run nicer wrt to cpu utilization,
>> > rather than at the default 0 nice?
>> >
>> > Thx,
>> >
>> > -Jim P.
>> >
>> nice -19 perl <args>
>>
>> or, if the script is already running,
>>
>> renice 19 <process-id-of-perl>
>>
>> ought to fix you up.
>
> Well, I already know that... what I'm looking for is a way to
> force /usr/bin/blah.pl to always be nice 10 regardless of who runs it.
#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw( nice );
## yadda yadda yadda
nice( 10 ) or warn "Can't nice( 10 ) myself: $!\n";
## rest of your program here . . .
exit 0;
__END__
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org| Vincent, you should cease askin' \ o.O'
| scary questions." -- Jules =(___)=
| U
More information about the Ale
mailing list