Process priorities and X

Richard Todd rmtodd at servalan.uucp
Wed Jul 4 16:14:31 AEST 1990


de5 at STC06.CTD.ORNL.GOV (SILL D E) writes:
>A user on a DG Aviion is complaining that background jobs run by cron
>are running at higher priorities than X clients, e.g., ps shows the
>server at 20, the background job at 22, and xterm at 24.  Apparently,

  Is said user, by any chance, using twm?  I'm running X11R4 with twm on a
Mac IIx, and I've noticed that clients that are started from twm (by some
twm menu action) are niced down by 4, and clients that are started by hand
run at normal niceness.  

  Reading this message, I decided to do some investigating (i.e. grepping thru
the source...)  I couldn't find a single call to nice() (the syscall that
lowers process priority) anywhere in the twm or Xlib source; "nm twm" doesn't
even list nice!  Obviously the clients twm starts are lowering themselves in
priority somehow, but I don't see how.  Something weird's going on here,
folks.

>My questions are:
>    -does the DG, or do SYS V systems in general, have `renice'?

  In general, no, SysV systems don't support renice, because they don't 
support the appropriate system call (setpriority(), I believe).  
The only way to change the process priority is a. when it starts or b. by
writing a program to fiddle the priority fields in the kernel process table
in /dev/kmem directly.  I've done the latter (being fed up with A/UX's lack of
renice), but it's ugly.  Boy is it ugly.  Not to mention that writing to
/dev/kmem is not an activity for the timid....

>    -anyone else seen this behavior on DG's or under X on other
>        systems? 

  See above.  

>    -aren't long-running jobs automatically nice'd by the kernel?

	They are on BSD systems.  I've never seen it happen on my Mac, so 
I suspect it isn't true on SysV in general.

>    -is there any way to boost the priority of X clients at
>        invocation-time other than `nice -N xclient...'?

   Even that won't boost your priority if you're not root, at least not on
any Unix I'm familiar with -- non-root users can only make their priorities
worse, not better.  

   You could always go and change your startup script/inittab/whatever to
make cron do its stuff at really bad priority, though...

--
Richard Todd	rmtodd at uokmax.ecn.uoknor.edu  rmtodd at chinet.chi.il.us
	rmtodd at servalan.uucp



More information about the Comp.unix.questions mailing list