- 论坛徽章:
- 1
|
《ULK3》
SCHED_FIFO
A First-In, First-Out real-time process. When the scheduler assigns the CPU to the process, it leaves the process descriptor in its current position in the runqueue list. If no other higher-priority real-time process is runnable, the process continues to use the CPU as long as it wishes, even if other real-time processes that have the same priority are runnable.
不知道LZ用的内核是哪个版本
新的内核用的CFS,不知道是如何处理的
之前的内核使用O(1)调度算法时是采用ULK3中描述的方式的
以2.6.11为例,进程的优先级为0-139,其中0-99是实时进程,
调度方式有SCHED_FIFO和SCHED_RR
这里A的优先级低于B的优先级
A和B同时启动
1)若A先执行,调度切换到B之后会一直等到B执行完成
2)若B先执行,则A会等待B执行完毕之后再执行
3)若都放入调度队列,但还未执行,根据调度队列的组织方式,先执行高优先级队列中的进程
这样B先执行,A要等到B执行完毕后才有机会执行
没有看过CFS,应该与上面描述的情况不同 |
|