1.多级队列调度(MLQ):
仅拥有一个队列并安排所有进程是非常困难的。这是使用多级队列调度的地方。在此过程中,根据进程的属性(例如系统进程,I / O进程等)将进程分为各种类别。因此,对于n类进程,我们获得了“ n”个队列。每个队列都分配了一个优先级,并且可以使用自己的调度算法,这使得同时使用多个调度算法变得很方便。通常,最高级别的队列具有最高优先级,随着我们移至较低级别,该优先级会降低。如果较高级别的绝对优先级高于较低级别的优先级,则它是不可抢占的,否则,如果时间片在各个队列之间划分,则其本质上将成为可抢占的。
- 好处 :
该算法的主要优点是我们可以在不同的队列中同时使用各种算法,例如FCFS,SSJF,LJF等。 - 缺点:
最低级别的过程遭受饥饿问题的困扰。
2.先来先服务(FCFS)调度算法:
它是最简单的非抢占式调度算法。在“先到先服务”(FCFS)中,进程按到达顺序分配给CPU。队列数据结构用于实现FCFS调度算法。当CPU空闲时,位于就绪队列开头的进程将分配给CPU。然后,将从队列中删除正在运行的进程。当新进程进入就绪队列时,它将放置在就绪队列的尾部。
FCFS和多级别队列调度之间的区别:
First Come First Served (FCFS) | Multi Level Queue Scheduling |
---|---|
First Come First Served (FCFS) is the non-preemptive scheduling algorithm. | MLQ can be non-preemptive or preemptive depending on the conditions. |
It executes the processes in ascending order of their arrival time. | Processes are executed depending on the priority of that particular level of queue to which the process belongs. Further selection of process is based upon the type of algorithm used in that particular queue. |
FCFS has the minimal overhead. | MLQ has some CPU overhead as it needs to switch between the queues. |
First Come First Served Scheduling Algorithm provides high response time for the processes. | Response time may be high or low depending upon the algorithms used in various levels of the multi level queue. |
FCFS is inconvenient to use in the time sharing system. | It can be implemented in any system depending upon the need. |
Average waiting time is generally not minimal in First Come First Served Scheduling Algorithm. | Average waiting time depends upon the algorithms used in various levels of queues. |
It is the simplest type of algorithm. | It is complex algorithm and is difficult to implement. |
It leads to convoy effect. | It leads to the starvation of processes at lower levels. |