010-100 · Question #92
What is the default process priority when a process is started using the nice command?
The correct answer is B. 10. When nice is invoked without a -n argument, it applies a default niceness adjustment of +10, giving the process a nice value of 10.
Question
What is the default process priority when a process is started using the nice command?
Options
- A-10
- B10
- C20
- D0
How the community answered
(20 responses)- A5% (1)
- B70% (14)
- C5% (1)
- D20% (4)
Why each option
When nice is invoked without a -n argument, it applies a default niceness adjustment of +10, giving the process a nice value of 10.
-10 would increase a process's CPU priority above the default, requiring root privileges; it is not the default behavior of nice.
Linux nice values range from -20 (highest CPU priority) to 19 (lowest). A normal process starts at nice value 0. Running nice command without specifying an increment adds the default offset of +10, resulting in a nice value of 10, which lowers the process priority relative to other processes. This default is defined by POSIX and implemented in GNU coreutils.
20 is outside the valid nice value range of -20 to 19 and is not the default increment applied by nice.
0 is the nice value of a process started normally without nice; the nice command's purpose is to apply an adjustment, so leaving it at 0 would be a no-op.
Concept tested: nice command default priority adjustment value
Source: https://man7.org/linux/man-pages/man1/nice.1.html
Topics
Community Discussion
No community discussion yet for this question.