A/UX: Change Process Priority with nice (1) and (2)


Article Change History
----------------------
08/31/92 - REVIEWED
* For technical accuracy.


Apple gives a high priority or time slice to the mac32 process. I'm developing
a product that needs to throw up a dialog saying that it's going to process
data and then take over as much of the CPU's time as possible.

Do you have any tools and/or facilities to give priorities to specific tasks?
Ultimately, I would like to shut off tasks like network deamons, cron deamons,
and so on.

A/UX supports both nice (1) and nice (2). These let you run or change the
priority of a process.

nice (1), which is available from the command level, executes the specified
command with a lower or higher CPU scheduling priority. Note that the nice
built-in function in the C shell is different from /bin/nice, so be careful
using nice. The superuser may run commands with priority higher than normal by
using a negative increment. For example:

/bin/nice --15 wc /usr/dict/words

causes the program "wc" to be run with higher priority than a normal process.
See nice (1) manual page for more details.

nice (2) is a system call to change the priority of a process. It adds the
increment value (specified in the argument) to the value of the calling
process. See nice (2) manual page for more details.


Published Date: Feb 18, 2012