Compare ordinary processes A and B under the same scheduling policy.
A has nice 5 and B has nice 15.
Which description is generally correct?
A larger nice value means the process is more willing to yield CPU to other ordinary processes, so it is in a lower-priority direction.
Detailed explanation
Incorrect. A larger nice value does not mean higher CPU priority.
Incorrect. A larger nice value does not mean higher CPU priority.
Incorrect. nice is a scheduling priority adjustment and is not unrelated to CPU scheduling.
Incorrect. nice is a scheduling priority adjustment and is not unrelated to CPU scheduling.
Correct. A's lower nice value places it in the higher-priority direction than B.
Correct. A's lower nice value places it in the higher-priority direction than B.
Incorrect. Scheduling priority does not guarantee that B completes first or last.
Incorrect. Scheduling priority does not guarantee that B completes first or last.
Try it yourself
An example you can run in a temporary verification environment.
nice -n 5 bash -c 'ps -o ni= -p "$$"'; nice -n 15 bash -c 'ps -o ni= -p "$$"'Expected result
5と15(呼出し元のnice値が0の場合)Key points
- A lower nice value is the higher-priority direction
- A larger value yields CPU more readily
- Completion order is not guaranteed
Notes
- Environment: Linux / GNU coreutils・procps-ng
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.