October 2018
Beginner
794 pages
19h 23m
English
So, now you may be wondering, if all non-real-time threads (the SCHED_OTHER chaps) have a priority of zero, then how can I support prioritization between them? Well, that's exactly what the nice value of a SCHED_OTHER thread is for: it's the (older) Unix-style priority model and now, on Linux, specifies a relative priority between the non-real-time threads.
The nice value is a priority range between -20 to +19 (on modern Linux), with the base priority being zero. On Linux, it's a per-thread attribute; when a thread is created, it inherits the nice value of its creator thread—zero being the default. Refer to the following diagram:
From 2.6.23 (with the CFS kernel scheduler), the nice ...
Read now
Unlock full access