"Deep Background" applications

Jon Sweedler cjosta at taux01.UUCP
Sun Jun 26 20:10:02 AEST 1988


In article <2772 at ttrdc.UUCP> levy at ttrdc.UUCP (Daniel R. Levy) writes:
>In article <11019 at cgl.ucsf.EDU>, seibel at cgl.ucsf.edu (George Seibel) writes:
>#In article <29500025 at urbsdc> aglew at urbsdc.Urbana.Gould.COM writes:
>#]For example, fixed priority
>#]scheduling - there have been many times that I wanted to have
>#]a "deep background" application, that would run only when the
>#]system is otherwise idle. No matter how much you nice, your
>#]process will still take some cycles away when the system isn't
>#]idle.

Not true (at least according to the "renice" man page...)

>#We'd really like a way to make
>#those jobs butt out when someone wants to run a short (10 min-1 hr)
>#job.   Does anyone know of an easy way to do something like this on
>#a bsd 4.[2-3] system?

Yes, just run a process with a priority of 20 (see below).

>
>Maybe a watch-dog program could be kludged up to use SIGSTOP to suspend
>the multi-day jobs when another job goes into background?  (If the new job
>takes too long, or when it finishes, the stopped jobs would be restarted with
>SIGCONT.)

This is much more complicated than necessary.  According to the "renice" 
man page, running a process with a priority of 20 (PRIO_MAX really) will
accomplish this (I don't know why it doesn't say this in the "nice" man
page as well...):

RENICE(8)	    UNIX Programmer's Manual		RENICE(8)

NAME
     renice - alter priority of running processes
.
.
.
     Useful priorities are: 20 (the affected processes
     will run only when nothing else in the system wants to)

-- 
Jon Sweedler   =====   National Semiconductor (Israel)
UUCP:   {ames!amdahl,hplabs,sun,decwrl}!nsc!taux01!cjosta
Domain: cjosta at taux01.nsc.com
Paper:  6 Maskit st., P.O.B. 3007, Herzlia B 46104, Israel



More information about the Comp.unix.questions mailing list