Re: process priority in linux

Shawn Bayern (shawn.bayern@yale.edu)
Mon, 22 Feb 1999 21:20:42 -0500 (EST)

On Mon, 22 Feb 1999, Chad Glendenin wrote:

> > I have a process that I would like to have use any _free_ clock cycles,
> > but that would ease off if any other process needed the cpu.
>
> hmm, dunno about that one.

As other people have described, this happens by default anyway -- at
least, in a loose sense. Depending on how the process is written and what
it does, either simply running it or using 'nice' will probably be fine.

The man page for sched_setscheduler(2) describes Linux's scheduling
policies. Basically, the actual priority of a normal process is based on
(a) its 'nice' value and (b) how long it has been waiting to run. Thus,
as Matt pointed out, the behavior only approximates what you want; it
doesn't actually do it perfectly.

As far as I know, there's no way to really set a process 'idle' in the
regular kernel. There have definitely been discussions about this, though;
for example, see

http://www.dejanews.com/getdoc.xp?AN=379533758

for a proposed kernel patch. (You could even try it yourself if you're
adventurous.)

Shawn