sched_setscheduler says :
All scheduling is preemptive: if a process with a higher static priority becomes ready to run, the currently running process will be preempted and returned to the wait list for its static priority level.
while setpriority says
This causes very low nice values (+19) to truly provide little CPU to a process whenever there is any other higher priority load on the system, and makes high nice values (-20) deliver most of the CPU to applications that require it
So, how is changing the nice value going to influence the execution of programs? Is it similar to RT scheduling (where a program with higher nice value is going to interrupt program with lower nice value)?
All information on internet is how to use
nice, and how to change priority of a process. No link explains how exactly process with different priority works. I couldn't even find the source code.