[net.micro.mac] Unix nices and AmigaDOS priorities

mwm@eris.berkeley.edu (Mike Meyer) (09/28/86)

A little bit of misinformation on the Unix nice/priority scheme has
been spread, along with some correct information. Just thought I'd
take this chance to get all the correct information in one place.

First, the closest thing to the AmigaDOS "priority" is the Unix nice.
Nice is *not* a priority. Unix recalculates priorities dynamically,
based on lots of magic - exactly what magic depending on what Unix
we're talking about. A processes nice gets added to the priority
towards the end of this calculation (and may be used in the
calculation). Thus, a process with lower nice will tend to get more
CPU than processes with higher nice (as mentioned elsewhere, this is
the opposite of AmigaDOS priorities).

This means that, unlike AmigaDOS, on Unix, nices are *NOT* relative -
a large positive nice gets you less CPU than a slightly positive nice,
even if no other process has a positive nice.

However, you can still lock up a Unix system by fooling with nices.
Give a CPU-bound process a large negative nice, and then try to kill
it :-).

The Unix method is, in general, better - processes with the same nice
will tend to get about the same percentage of the CPU, over the long
run. Since most interactive processes don't use a lot of CPU, they get
more than CPU-intensive jobs over the short run (when they are
active), and everybody is happy.

On the other hand, there aren't usually many CPU-intensive jobs on the
Amiga, and there's (normally) only one user. So AmigaDOS uses a
simpler (== less system overhead) scheduling method, and most of the
time, everybody is happy, and you get a little extra CPU.

Looking back over the above, it seems obvious that those trying to
turn the Amiga into a multi-user machine are going to be dissapointed.
There are other good reasons for avoiding that, as well; mostly
involving the same kind of tradeoff: do it the fast way that works for
one user instead of the slow way that works for many.

Of course, trying to turn the Amiga into another Unix box is a major
disservice both to the Amiga and to it's users.

	<mike