Changing the nice() value of a running process.

Leo de Wit leo at philmds.UUCP
Thu Jan 26 04:13:01 AEST 1989


In article <8818 at alice.UUCP> debra at alice.UUCP () writes:
    []
|If all processes run at the same lowered priority the scheduling should
|remain the same. What you did however had 2 effects:
|1) The database program runs at a lower priority than your user interface
|   which means that the user interface will respond better. This explains
|   why the cursor is no longer hesitating.
|2) It looks like you are running the program from a shell script. The
|   "nice" command is not build in (in the bourne shell), which means you
|   are now invoking twice as many processes, which aren't doing much, but
|   the nice process sits waiting for the database program to finish.

If nice was implemented to wait for a child to terminate, this would be
the case. But this wouldn't be a nice implementation of nice (8-), since
all it has to do is lower the priority, then execve() its own (shifted)
arguments. On Ultrix:

$ nice -10 ps gx
  PID TT STAT  TIME COMMAND
 4766 ia TW    0:43 rn
 5914 ia R N   0:01 ps gx
17932 ia S     0:18 esh
$

No sign of a waiting nice process...

	 Leo.



More information about the Comp.unix.wizards mailing list