Linux schedule introduction
来源:互联网 发布:网络基站建设方案 编辑:程序博客网 时间:2024/04/30 04:14
The scheduler is alsoinvoked by kernel functions that block the current task, and this allows the scheduler to decide on which task on the run-queue should run and context switch to that task.
Exit-paths of most critical sections within the kernel may invoke the scheduler especially if the critical section had scheduling disabled for more than a jiffy. This is just a good practice within kernel-space development in order to have a more responsive system.
For example, preempt_enable() function may invoke schedule() if thepreempt count becomes zero and need_resched() returns true.
Schedule() function at its simplest is a function which tells the process scheduler to run the next task in its runqueue. This runqueue is maintained per CPU.
Scheduler (Per CPU) has its own way to determine which is next task shall be made based on the priority associated with the task.
As to how it is called is: Any kernel code can by itself declare to give up its turn of running on CPU by calling schedule(). That's like i saying i got an change to run on CPU and i found based on some condition i do not have any meaning full work, so its better i go to sleep and wait for my next turn.
The calling is as simple as writing schedule(); after you condition of no work in your code.
So, schedule() the way in kernel when you want a process to go voluntarily to go sleep.
Ever thought what is the opposite to schedule () .. When we want our process to wake up voluntarily ? Its wake_up().
- Linux schedule introduction
- linux schedule
- linux schedule() 流程图
- linux 调度 schedule分析
- linux schedule() 流程图
- linux io schedule: CFQ
- linux schedule and queue
- linux schedule 数据结构
- Linux schedule 6、Cgoup
- Linux schedule (目录)
- linux filesystem introduction
- 初识Linux--Introduction
- [Linux]Introduction Of Trac
- Linux scheduler(cfs) introduction
- Linux DVB: An Introduction
- Introduction to Linux
- Linux Introduction && Commands
- Introduction to Linux
- 假装全新的开始
- js查找大小值
- request的常用方法
- 安卓自定义View进阶-Canvas之绘制图形
- 仿新版QQ锁屏下弹窗
- Linux schedule introduction
- vncserver -kill后面冒号左右空格的影响
- use boost.python to Warp C++ for python
- Struts2学习——1400OGNL2访问方法与属性
- as自定义keystore+系统自带debug.keystore +生成数字签名
- 织梦后台栏目显示文档数不为0,但点进去之后什么都没有
- 关于searchBar放大镜居左的设置
- spring-依赖注入的注解配置
- Retrofit 简单使用之二