real time scheduling in Linux

后端 未结 4 1123
天命终不由人
天命终不由人 2020-12-07 17:49

This morning I read about Linux real time scheduling. As per the book \'Linux system programming by Robert Love\', there are two main scheduling there. One is SCHED_FIFO, fi

4条回答
  •  無奈伤痛
    2020-12-07 18:39

    According to the man page, I think 1 is the answer. A, B are RR policy, C is FIFO policy. Since RR is also an enhancement FIFO, all of them are FIFO class.

    Since all of them have the same priority, and man page say " A call to sched_setscheduler() or sched_setparam(2) will put the SCHED_FIFO (or SCHED_RR) process identified by pid at the start of the list if it was runnable. As a consequence, it may preempt the currently running process if it has the same priority. (POSIX.1-2001 specifies that the process should go to the end of the list.)"

    Once calling sched_setscheduler to set the policy of C as FIFO, C will preempt A.

提交回复
热议问题