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.
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.