1.多级队列调度(MLQ):
仅拥有一个队列并安排所有进程是非常困难的。这是使用多级队列调度的地方。在这种情况下,根据进程的属性(例如系统进程,I / O进程等)将进程分为各种类别。因此,对于n类进程,我们获得“ n”个队列。每个队列都分配了一个优先级,并且可以使用自己的调度算法,这使得同时使用多个调度算法变得很方便。通常,最高级别的队列具有最高优先级,当我们移至较低级别时,优先级会降低。如果较高级别相对于较低级别具有绝对优先级,则它是非抢占式,否则,如果时间片在各个队列之间划分,则其本质上将成为抢占式。
- 好处 –
该算法的主要优点是我们可以在不同的队列中同时使用各种算法,例如FCFS,SJF,LJF等。 - 缺点–
最低级别的进程遭受饥饿问题的困扰。
2.最长的工作优先(LJF):
最长作业优先是一种非抢占式调度算法。该算法基于进程的突发时间。根据进程的突发时间,即按照突发时间的降序,将它们放入就绪队列。顾名思义,该算法基于以下事实:首先处理突发时间最大的进程。仅考虑那些在该时间之前已进入系统的进程的突发时间。它的抢占版本称为最长剩余时间优先(LRTF)算法。
笔记 –
如果两个进程的突发时间相同,则使用FCFS断开联系,即首先处理最先到达的进程。
缺点–
- 对于给定的一组过程,该算法提供了很高的平均等待时间和平均周转时间。
- 这可能导致车队效应。
- 可能会发生一个短流程永远不会执行的情况,并且系统会继续执行更长的流程。
- 它降低了处理速度,从而降低了系统的效率和利用率。
最长作业优先(LJF)和多级队列调度(MLQ)之间的区别:
S.NO. | Longest Job First (LJF) | Multi Level Queue (MLQ) |
---|---|---|
1. | It executes processes based upon their burst time i.e. in descending order of their burst times. | Processes are executed depending on priority of that particular level of queue to which process belongs. Further selection of process is based upon type of algorithm used in that particular queue. |
2. | It is non-preemptive but its preemptive version is also there called Shortest Remaining Time First (SRTF) algorithm. | It can be both preemptive and non preemptive in nature depending upon conditions. |
3. | The average waiting time for given set of processes is quite long which reduces effectiveness of system. | There is no idea of average waiting time and response time as it completely depends upon algorithms used in various levels of multi-level queue. |
4. | A long process may never get executed and system may keep executing short processes. | It leads to starvation of processes at lower levels of multi level queue. |