On Linux SCHED_FIFO and SCHED_RR

后端 未结 4 1255
陌清茗
陌清茗 2020-12-29 12:03

I\'m writing a a very small daemon that must remain responsive even when a system is under severe stress. I\'m looking at the differences between SCHED_FIFO and SCHED_RR in

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 12:39

    I'm not an expert for scheduling schemes, but have a look at

    man sched_setscheduler
    

    it details what the difference between the different scheduling algorithms are, and provide links to other scheduling functions. SCHED_FIFO actually sounds pretty dangerous, but is described as the most aggressive scheduling:

    A SCHED_FIFO process runs until either it is blocked by an I/O request, it is preempted by a higher priority process, or it calls sched_yield(2).

    Beware not to lock up your system. I would personally do some empirical tests to see what priority fits the best and how they behave exactly.

提交回复
热议问题