The SCHED_OTHER/SCHED_NORMAL policy implements the so-called completely fair scheduler (CFS). This recipe will show you how to set the nice value for normal processes in order to increase their priority. We'll see that the nice value is used to weigh the timeslice that a process has. Priority must not be confused with the real-time priority, which is specific to the SCHED_FIFO and SCHED_RR policies.
Learning how to set a nice value
How to do it...
In this recipe, we'll implement a program that will increase the nice value of a process:
- On a shell, open a new source file called schedNice.cpp. We need to add some includes and call the nice() system call by passing the value we want to...