📌  相关文章
📜  多级队列调度(MLQ)和优先级调度之间的区别

📅  最后修改于: 2021-08-27 04:56:27             🧑  作者: Mango

1.多级队列调度(MLQ):
仅拥有一个队列并安排所有进程是非常困难的。这是使用多级队列调度的地方。在这种情况下,根据进程的属性(例如系统进程,I / O进程等)将进程分为各种类别。因此,对于n类进程,我们获得“ n”个队列。每个队列都分配了一个优先级,并且可以使用自己的调度算法,这使得同时使用多个调度算法变得很方便。通常,最高级别的队列具有最高优先级,当我们移至较低级别时,优先级会降低。如果较高级别的绝对优先级高于较低级别的优先级,则它是非抢占性的,否则,如果在各个队列之间划分时间片,则它实际上是抢占性的

  • 好处 –
    该算法的主要优点是我们可以在不同的队列中同时使用各种算法,例如FCFS,SJF,LJF等。
  • 缺点–
    最低级别的过程遭受饥饿问题的困扰。

2.优先级调度算法:
优先级调度算法根据进程的优先级执行进程。为每个进程分配一个优先级,并首先执行具有最高优先级的进程。可以在内部和外部定义优先级。内部优先级是由系统决定的,具体取决于所需的资源数量,所需的时间等,而外部优先级则取决于需要工作的时间或为完成的工作支付的金额或过程的重要性。优先级调度可以是抢占式,也可以是非抢占式。
笔记 –

  • 如果两个进程具有相同的优先级,则使用FCFS断开连接。
  • 在抢占模式下,最高优先级进程的等待时间始终为零,而在非抢占模式下的等待时间可能不为零。

缺点:
主要问题是饥饿或无限期封锁。可能会发生这样的情况,在进程流中,系统会继续执行高优先级进程,而永远不会执行低优先级进程。 MLQ和优先级调度算法之间的区别:

S.No. Multi level queue scheduling (MLQ) Priority scheduling
1. 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. It executes processes based upon their priorities i.e. in descending order of their priorities. A process with higher priority is executed first.
2. It can be both non-preemptive and preemptive in nature depending upon conditions. It is both preemptive and non preemptive in nature.
3. Average waiting time and average response time depends upon algorithms used in various levels of multi level queue for scheduling. There is no idea of average waiting time and response time.
4. It leads to starvation of processes at lower levels of multi-level queue. The problem of blocking of a process can be solved through aging which means to gradually increase priority of a process after a fixed interval of time by a fixed number.