Assuming we have read the following question: Change niceness (priority) of a running process and we know about root, non-root permissions:

What actually happens when a running process (Through renice) or a new process (Through nice) gets its priority changed to a positive/negative value it previously had.

  • Does it mean more memory is assign to it?
  • Does more CPU power go to that particular process?
  • Does it reduce any timing for resources for that process?

What happens when the process priority change?


In PCs running recent OSs processes seem to run simultaneously, but are actually running one after another. Processes can be in several states, simplified here:

  • running (currently claiming CPU time)
  • ready (ready to claim the CPU for some work)
  • wait (waiting for other processes via inter-process communication, or I/O like disk or network)
  • sleep ("I don't need your time now")

The priority a process has tells the scheduler to pick the process with the highest priority with a ready state to allow to use the CPU. So, in the case where several processes are in the ready state, the one with the highest priority will get most of the time. And because Linux is a preemptive kernel, it can put processes from the running state on hold and let other processes do their work. The time processes get is divided in timeslices and the algorithm for the actual scheduling can also be selected.

Changing the nicelevel does not change anything for the memory manager as far as I know, but yes, it does influence on resource locking in a way that processes with a higher priority should finish earlier.

I suggest you to read more on this topic: Wikipedia: Preemptive multitasking and O'Reilly - Understanding the Linux Kernel (2000)

And, by the way, please note that a lower nicelevel means higher priority in Linux.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.