Linux SCHED_OTHER,SCHED_FIFO和SCHED_RR-差异 [英] Linux SCHED_OTHER, SCHED_FIFO and SCHED_RR - differences

查看:115
本文介绍了Linux SCHED_OTHER,SCHED_FIFO和SCHED_RR-差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释SCHED_OTHER,SCHED_FIFO和SCHED_RR之间的区别吗?

谢谢

解决方案

SCHED_FIFO和SCHED_RR被称为实时"策略.它们执行POSIX标准指定的固定优先级实时调度.具有这些策略的任务会抢占其他所有任务,因此很容易陷入饥饿(如果它们不释放CPU).

SCHED_FIFO和SCHED_RR之间的区别在于,在具有相同优先级的任务中,SCHED_RR执行具有特定时间片的循环. SCHED_FIFO则需要任务来显式产生处理器.

SCHED_OTHER是常见的轮询分时调度策略,该调度策略根据系统中运行的其他任务为某个时间片调度任务.

更新:自Linux 3.14起,还有一个名为 SCHED_DEADLINE 的附加政策一个>.此策略在最早截止日期优先队列的顶部实现了恒定带宽服务器(CBS)算法.在此策略下,为每个任务分配了截止日期,并执行了最早截止日期的任务.描述该算法的最佳资源是 Linux内核中的截止时间调度. /p>

更新2 :自Linux 4.13起,SCHED_DEADLINE已用未使用带宽(GRUB)算法.

Can someone explain the differences between SCHED_OTHER, SCHED_FIFO and SCHED_RR?

Thanks

解决方案

SCHED_FIFO and SCHED_RR are so called "real-time" policies. They implement the fixed-priority real-time scheduling specified by the POSIX standard. Tasks with these policies preempt every other task, which can thus easily go into starvation (if they don't release the CPU).

The difference between SCHED_FIFO and SCHED_RR is that among tasks with the same priority, SCHED_RR performs a round-robin with a certain timeslice; SCHED_FIFO, instead, needs the task to explicitly yield the processor.

SCHED_OTHER is the common round-robin time-sharing scheduling policy that schedules a task for a certain timeslice depending on the other tasks running in the system.

Update: since Linux 3.14, there is an additional policy called SCHED_DEADLINE. This policy implements the Constant Bandwidth Server (CBS) algorithm on top of Earliest Deadline First queues. Each task under this policy is assigned a deadline, and the earliest-deadline task is executed. The best resource describing this algorithm is Deadline scheduling in the Linux kernel.

Update 2: since Linux 4.13, SCHED_DEADLINE has replaced CBS with the Greedy Reclamation of Unused Bandwidth (GRUB) algorithm.

这篇关于Linux SCHED_OTHER,SCHED_FIFO和SCHED_RR-差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆