当前位置:网站首页>Scheduler (Long-term,Short-term, Medium-term Scheduler) & Dispatcher
Scheduler (Long-term,Short-term, Medium-term Scheduler) & Dispatcher
2022-08-04 05:33:00 【学习溢出】
What is scheduler?
To execute many processes together on the CPU.
The scheduler selects the process form the ready queue and allocates the CPU to that process…
Ready queue is maintained by any of the scheduling algorithms like First come first served, shortest job first or priority scheduling algorithm etc.
Long-term scheduler
The long-term scheduler selects a job from the job queue and allows a process to load it into the main memory. It means that this is the schedule that handles that how much maximum jobs/processes can be loaded on the main memory.
Sometimes the number of processes submitted to the system are more than it can be executed immediately. Then in such cases, the processes are spooled on the mass storage, where they reside to get executed later.
The Long-Term Scheduler then select the process from this spool which is also called as Job Pool and load them in the Ready Queue for their further execution.
Job Scheduler
Short term scheduler
Short term scheduler selects a process from ready queue and allocates CPU to that process. After this state of a process is change from ready state to running state.
CPU Scheduler
The frequency of Long-Term Scheduler to pick up the processes from Job pool is less as compared to the Short-Term Scheduler.
Differences between Long-term Scheduler & Short-term Scheduler
BASIS FOR COMPARISON | BASIS FOR COMPARISON | SHORT-TERM SCHEDULER |
---|---|---|
Basic | It picks up the process from Job Pool/Job Queue. | It picks up the process from Ready Queue. |
Frequency | Long-Term Scheduler selects the process less frequently. | Short-Term Scheduler select the process more frequently. |
Control | It controls the Degree of Multiprogramming. | It has less control over the Degree of Multiprogramming. |
Alternative | Alternatively, it is called Job Scheduler. | Alternatively, it is called CPU Scheduler. |
Important | Long-Term Scheduler is there in Batch Systems but it may or may not be present in Time Sharing System. | Short-Term Scheduler is there in Batch System and is minimally present in the Time Sharing System also. |
Key Differences Between Long-Term Scheduler and Short-Term Scheduler
- The Long -Term Scheduler select the processes from the Job pool. On the other hand, the Short-Term Scheduler selects the processes from the Ready queue.
- The Short Term Scheduler executes more frequently as compared to the Long-Term Scheduler.
- Long-Term scheduler controls the degree of multiprogramming whereas, the Short-Term Scheduling has less control over the degree of Multiprogramming.
- Long-Term Scheduling is also called Job Scheduler. On the other hand, the Short-Term Scheduling is also called CPU Scheduler.
- The Long-Term Scheduler is necessarily there in Batch System and may or may not be minimally present in the Time sharing system. On the other hand, the Short-Term Scheduler is there in Batch System and also minimally present in the Time Sharing System.
Medium-term scheduler
Most often, a running process needs I/O operation which doesn’t requires CPU. Hence during the execution of a process when a I/O operation is required then the operating system sends that process from running queue to blocked queue. When a process completes its I/O operation then it should again be shifted to ready queue. ALL these decisions are taken by the medium-term scheduler. Medium-term scheduling is a part of swapping.
The medium-term scheduler can be added if the degree of multiple programming needs to decrease
The degree of multiprogramming describes the maximum number of processes that a single-processor system can accommodate efficiently.
A medium-term scheduler is responsible for swapping. Some jobs are swapped from hard disk to the main memory and some jobs can be swapped out from the main memory to the hard disk.
Dispatcher
The dispatcher is the module that gives a process control over the CPU after it has been selected by the short-term scheduler.
Function as Following Steps:
- Context Switching
- Switch to user mode
- Jumping to proper location when process again restarted
The time taken by dispatcher is called dispatch latency.
Reference
https://techdifferences.com/difference-between-long-term-and-short-term-scheduler.html
https://www.geeksforgeeks.org/difference-between-dispatcher-and-scheduler/
边栏推荐
猜你喜欢
随机推荐
复杂格式的json转递
你要悄悄学网络安全,然后惊艳所有人
[English learning][sentence] good sentence
【HIT-SC-MEMO2】哈工大2022软件构造 复习笔记2
【C语言】数组名是什么
C# 剪裁图片内容区域
LeetCode刷题
网络安全工程师们改不掉的“老毛病”
【HIT-SC-MEMO1】哈工大2022软件构造 复习笔记1
结构体传参-C语言
Uos统信系统 DNS
IE8 打开速度慢的解决办法
益智小游戏- 算算总共多少正方形
Uos统信系统 SSH
【HIT-SC-LAB2】哈工大2022软件构造 实验2
用chrome dev tools 强制js注入
webrtc代码解读一:音频数据的接收解码播放过程
文件编辑器
一场聚会,转行渗透测试月薪13.5k,感谢那个女同学......
selenium webdriver 防爬问题 C#