On Thu, Oct 03, 2002 at 05:12:38PM -0700, Jessee Parker wrote:
> I will definitely take a look at this. How do you determine what your
> current "nice" status is?

nice, with no arguments, will give you your current nice level.  ps and top
will diplay the nice level (or sometimes priority) of processes.  Also,
BSD::Resource, found on CPAN, has a method for retrieving a process's
priority.  I'm fairly certain there are more ways of getting the information.

 
> > How did you verify the condition was never reached?  If you determined it
> > independently of the program printing to its log file then I'd have to see
> > the code to be able to tell you what's going on.
> 
> What I did was had top running and watched the load average.

Ok, the test was seperate.  Have you tried running strace on the program to
see where it's sleeping?  Are you certain it's sleeping, or is it possible
it's blocking on a read or write?


> The code I am using to check the load average is this:
 
>             $highload = ".8";
>             while (($currload = &Load) > $highload)
>             {
>                 print LOG "Sleeping\n";
>                 sleep 5;
>             }
> 
> sub Load {
>     # Test system load and wait if it's too high
>     @uptime = split(/,/, `uptime`);
>     $fraction = $uptime[3];
>     $load = (split /:/, $fraction)[1];
>     return $load;
> }

This code doesn't work for me, though it may be because of a difference in
uptime output.  Have you verified Load() returns the value you expect?

Also, &Load has slightly different meaning from Load(), due to the &.  It
doesn't look like it will effect you here, but you should check perldoc
perlsub for the difference between them.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to