实时进程RT的调度策略RR
来源:互联网 发布:cnc数控模拟软件 编辑:程序博客网 时间:2024/05/22 09:03
Time Slice 目前只用于RR策略.
默认的时间片长度是100 毫秒
/* * These are the 'tuning knobs' of the scheduler: * * default timeslice is 100 msecs (used only for SCHED_RR tasks). * Timeslices get refilled after they expire. */#define DEF_TIMESLICE (100 * HZ / 1000)
当处理Tick 的周期调度任务时
static void task_tick_rt(struct rq *rq, struct task_struct *p, int queued){ update_curr_rt(rq); watchdog(rq, p); /* * RR tasks need a special form of timeslice management. * FIFO tasks have no timeslices. */ if (p->policy != SCHED_RR)?// 如果不等于RR的话直接返回. return; if (--p->rt.time_slice)// 时间片减去1单位 return; p->rt.time_slice = DEF_TIMESLICE;//(100 * HZ / 1000) /* * Requeue to the end of queue if we are not the only element * on the queue: */ if (p->rt.run_list.prev != p->rt.run_list.next) {//判断是否唯一 requeue_task_rt(rq, p, 0);// 如果当前进程不是RQ上面的唯一进程时,重新加到队列尾部. set_tsk_need_resched(p);//设置重新需要调度标志位. }}
把task 放到队列尾部.
/* * Put task to the end of the run list without the overhead of dequeue * followed by enqueue. */static voidrequeue_rt_entity(struct rt_rq *rt_rq, struct sched_rt_entity *rt_se, int head){ if (on_rt_rq(rt_se)) { struct rt_prio_array *array = &rt_rq->active; struct list_head *queue = array->queue + rt_se_prio(rt_se); if (head) list_move(&rt_se->run_list, queue); else list_move_tail(&rt_se->run_list, queue); }}
阅读全文
0 0
- 实时进程RT的调度策略RR
- linux进程调度之 FIFO 和 RR 调度策略
- linux进程调度之 FIFO 和 RR 调度策略
- linux进程调度之 FIFO 和 RR 调度策略
- linux进程调度算法:分时调度策略、FIFO调度策略、RR调度策略
- Linux进程调度算法,不同的调度策略、实时性,完全公平调度算法CFS
- 对待实时进程(RT)抢占的问题
- 进程调度--FCFS,SPN,RR算法的实现
- 【IO进程】设置进程调度策略(实时进程)
- 普通进程的调度策略
- 操作系统 进程调度之轮换调度(RR调度)
- 实时组件的调度策略研究
- Linux实时调度策略
- 进程调度三种算法的实现(FCFS,SJF,RR)
- Linux中实时进程的调度
- linux内核实时进程的调度原理
- [小技巧] 查看进程的调度策略
- 进程调度及调度策略
- Servlet第五天
- 【分层实验框架】10分钟搞懂分层实验原理
- 镭神智能固态激光应用(LS-SD-N040A(B)-TA0-L)
- java验证jks证书的密码
- JS 倒计时插件 demo
- 实时进程RT的调度策略RR
- 错误记录--更改tomcat端口号方法,Several ports (8005, 8080, 8009)
- 草稿——swift的简单学习 -- 音乐播放器
- sklearn-KNN
- 关于列举属性用点还是用【】
- android内存泄漏检测工具leakCanary--代码工具备忘录
- C# BackGroundWorker 的简单使用
- python如何使用生成器函数实现可迭代对象
- HTML中的标签系列-02-表单标签等