Controlling the priority of user processes

User-process priorities can be manipulated using the nice or renice command or the setpri() subroutine, and displayed with the ps command.

An overview of priority is provided in Process and thread priority.

Priority calculation is employed to accomplish the following:
  • Share the CPU among threads
  • Prevent starvation of any thread
  • Penalize compute-bound threads
  • Increase continuous discrimination between threads over time