[mythtv-users] "Nice" recommendations

Nick Morrott knowledgejunkie at gmail.com
Tue Oct 31 15:27:39 UTC 2017


On 31 October 2017 at 14:36, Jan Ceuleers <jan.ceuleers at gmail.com> wrote:
> On 31/10/17 15:19, Nick Morrott wrote:
>> On 31 October 2017 at 14:14, Ozzy Lash <ozzy.lash at gmail.com> wrote:
>>
>>> Isn't a negative nice value giving the process a HIGHER priority?  I think
>>> you mean "nice 19"  correct?
>>
>> Correct. A lower nice value gives the process a higher priority.
>>
>> +ve (1 - 19): lower priority
>> 0: default priority
>> -ve (-1 - -20): high priority
>
> Although this is true you need to experiment with your implementation of
> "nice" as to how to feed it the desired niceness value.
>
> Start by noting that nice without parameters returns the current
> niceness value.
>
> Then experiment with different syntactic options and values:
>
> root at hobbiton:~# nice nice
> 10
> root at hobbiton:~# nice -19 nice
> 19
> root at hobbiton:~# nice --19 nice
> -19
> root at hobbiton:~# nice -n 19 nice
> 19
>
> So as you can see, if you feed it a niceness value it needs to be either
> preceded by a dash or by "-n ". If you want to specify a negative value
> then it needs two dashes (or "-n -").

My apologies. My blanket "correct" did not cover the second statement
separately, so thanks for the extra clarification.

>From the GNU docs:

"For compatibility nice also supports an obsolete option syntax
-adjustment. New scripts should use -n adjustment instead."

Please use `nice -n adj` (especially for scripts and hints posted to
the wiki and mailing lists) unless it's already burned into your
muscle memory and you are beyond hope :)

Cheers,
Nick


More information about the mythtv-users mailing list