I was looking for the old anwser found two solution. I have two process one is batch process and another is real time process. I want to give higher priority to the real-time process.
One is
setpriority
I can set priority of the process b/w -20 to 19. Where -20 is highest and 19 is lowest.
Question are
- which one is good number for a batch process ?
- Which one is good number for a realtime process ?
There is another method
sched_setscheduler
using that I can set schduling to SCHED_BATCH mode.
So another question is which function should I use sched_setscheduler or setpriority ?
You can also change the IO priority.
In practice, I’m using the following
reallynicescriptand I’m doing e.g.
The man page of
sched_setschedulermentions SCHED_FIFO & SCHED_RR for real-time processes.