Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!amdahl!nsc!taux01!cjosta From: cjosta@taux01.UUCP (Jon Sweedler) Newsgroups: comp.unix.questions Subject: Re: "Deep Background" applications Message-ID: <779@taux01.UUCP> Date: 26 Jun 88 10:10:02 GMT References: <649@necis.UUCP> <29500025@urbsdc> <11019@cgl.ucsf.EDU> <2772@ttrdc.UUCP> Reply-To: cjosta@taux01.UUCP (Jon Sweedler) Organization: National Semiconductor (Israel) Ltd. Lines: 45 In article <2772@ttrdc.UUCP> levy@ttrdc.UUCP (Daniel R. Levy) writes: >In article <11019@cgl.ucsf.EDU>, seibel@cgl.ucsf.edu (George Seibel) writes: >#In article <29500025@urbsdc> aglew@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@taux01.nsc.com Paper: 6 Maskit st., P.O.B. 3007, Herzlia B 46104, Israel