[ale] Putting an arbitrary process to sleep

Jeff Hubbs Jhubbs at niit.com
Thu Jan 4 10:21:41 EST 2001


This is true; SETI at Home, for instance, takes almost the whole CPU on my
Linux systems whether it's reniced or not, but I renice it to 19 so that
when I am running gramofile or notlame SAH essentially stops.

- Jeff

> -----Original Message-----
> From: hirsch at zapmedia.com [mailto:hirsch at zapmedia.com]
> Sent: Thursday, January 04, 2001 10:11 AM
> To: ale at ale.org
> Subject: Re: [ale] Putting an arbitrary process to sleep
> 
> 
> James Kinney writes:
>  > How 'bout a cron job? Every minute, test the 
> temp/voltage/etc. If temp is
>  > high, renice the high cpu offenders to 20 until the temp drops.
> 
> I don't think that will help reduce CPU utilization.  A "nice" job
> will yeild to any other task, but if the CPU is available it will
> still consume 100% of the CPU.  So the CPU will run just as hot.  
> 
> I don't know of a way to do this other than building custom hardware.
> 
> --Michael
>  > 
>  > Of course, if you are having consistent heat problems, you 
> need to address
>  > the hardware side of the problem with more cooling. The 
> system should be
>  > able to dissipate all the heat it produces even when under 
> 100% CPU load
>  > 24x7. The sensors are to warn of temp problems due to 
> cooling system
>  > failure. Throttling back cpu usage is a rather cludgy way 
> to avoid another
>  > noisy fan (or three).
>  > 
>  > JimK
>  > Local Net Solutions
>  > 
>  > On Thu, 4 Jan 2001, Wandered Inn wrote:
>  > 
>  > > "Joseph A. Knapka" wrote:
>  > > > 
>  > > > Does anyone know of a command or system call that
>  > > > one can issue to make an arbitrary process sleep
>  > > > for a given amount of time? "[u]sleep" puts the current
>  > > > process to sleep, but that's not what I need.
>  > > > 
>  > > > Rationale: I want to write a daemon that will monitor
>  > > > CPU temp and put certain processes (Seti at home, etc)
>  > > > to sleep for a while if it gets too high. Maybe
>  > > > there's already something like this around? Or maybe
>  > > > there's an easier way to accomplish the task that
>  > > > someone can suggest?
>  > > 
>  > > The only way I can see to do this would be to have the 
> processes you
>  > > want to be able to make go to sleep look for a signal 
> and when the
>  > > signal is received, the process goes to sleep.  Since 
> you probably don't
>  > > want to modify a bunch of programs, you could write a 
> wrapper program,
>  > > or even a script that would do this.  I just threw together the
>  > > following script I called 'sleepy':
>  > > 
>  > > trap 'echo I am tired; sleep 10' 16
>  > > while :; do
>  > >         date
>  > >         sleep 2
>  > > done
>  > > 
>  > > If you fire off this script, it writes the date out and 
> sleeps.  If you
>  > > send it a signal 16, it will print out 'I am tired', 
> sleep 10 seconds
>  > > and then resume.  Now this doesn't solve your problem 
> completely as you
>  > > couldn't just replace the 'date' with your programs.  
> What you might
>  > > have to do is to kill the process you want to go to 
> sleep, sleep the
>  > > specified time, then fire the process up again.
>  > > 
>  > > Maybe someone will come up with a better solution?
>  > > 
>  > > 
>  > > 
>  > > 
>  > > > 
>  > > > Thanks,
>  > > > 
>  > > > -- Joe Knapka
>  > > > --
>  > > > To unsubscribe: mail majordomo at ale.org with 
> "unsubscribe ale" in message body.
>  > > 
>  > > --
>  > > Until later: Geoffrey		esoteric at denali.atlnet.com
>  > > 
>  > > "Great spirits have always found violent opposition from 
> mediocre minds.
>  > > The
>  > > latter cannot understand it when a man does not 
> thoughtlessly submit to
>  > > hereditary prejudices but honestly and courageously uses his
>  > > intelligence."
>  > > - Albert Einstein
>  > > --
>  > > To unsubscribe: mail majordomo at ale.org with "unsubscribe 
> ale" in message body.
>  > > 
>  > 
> 
> 
> 
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" 
> in message body.
> 
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list