Difference between EDF and LST CPU scheduling algorithms Last Updated : 20 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 1. Earliest Deadline First (EDF) : In Earliest Deadline First scheduling algorithm, at every scheduling point the task having the shortest deadline is scheduled for the execution. It is an optimal dynamic priority-driven scheduling algorithm used in real-time systems. It uses priorities of the tasks for scheduling. In EDF, priorities to the task are assigned according to the absolute deadline. The task having shortest deadline gets the highest priority. Example - Suppose here are two processes P1 and P2. Let the period of P1 be p1 = 50 Let the processing time of P1 be t1 = 25 Let the period of P2 be p2 = 75 Let the processing time of P2 be t2 = 30 Explanation : Deadline pf P1 is earlier, so priority of P1>P2. Initially P1 runs and completes its execution of 25 time. After 25 times, P2 starts to execute until 50 times, when P1 is able to execute. Now, comparing the deadline of (P1, P2) = (100, 75), P2 continues to execute. P2 completes its processing at time 55. P1 starts to execute until time 75, when P2 is able to execute. Now, again comparing the deadline of (P1, P2) = (100, 150), P1 continues to execute. Repeat the above steps. Finally at time 150, both P1 and P2 have the same deadline, so P2 will continue to execute till its processing time after which P1 starts to execute. 2. Least Slack Time (LST) : In Least Slack Time scheduling algorithm, at every scheduling point the task having the minimum laxity is executed first. It is also a dynamic priority-driven scheduling algorithm used in real-time systems. It assigns some priority to all the tasks in the system according to their slack time. The task having the least slack time (laxity) gets the highest priority. Example - Process P1: Arrival Time=0, Duration=10, Deadline=33 Process P2: Arrival Time=4, Duration=3, Deadline=28 Process P3: Arrival Time=5, Duration=10, Deadline=29 Explanation : At time t=0: Only process P1 has arrived. P1 is executed till time t=4. At time t=4: P2 has arrived. Slack time of P1: 33-4-6=23 Slack time of P2: 28-4-3=21 Hence P2 starts to execute till time t=5 when P3 arrives. At time t=5: Slack Time of P1: 33-5-6=22 Slack Time of P2: 28-5-2=21 Slack Time of P3: 29-5-10=12 Hence P3 starts to execute till time t=13 At time t=13: Slack Time of P1: 33-13-6=14 Slack Time of P2: 28-13-2=13 Slack Time of P3: 29-13-2=14 Hence P2 starts to execute till time t=15 At time t=15: Slack Time of P1: 33-15-6=12 Slack Time of P3: 29-15-2=12 Hence P3 starts to execute till time t=16 At time t=16: Slack Time of P1: 33-16-6=11 Slack Time of P3:29-16-=12 Hence P1 starts to execute till time t=18 and so on. Difference between EDF and LST scheduling algorithms : EDF LST Task having shortest deadline is scheduled first in it. Task having minimum slack time is scheduled first in it. It assigns priority to tasks according to their deadlines. It assigns tasks according to their slack time. It can be used as both static and dynamic scheduling. It is used only as dynamic scheduling. Execution time of a task is not required. It requires execution time of a task. It is a simple and optimal algorithm. It is a complex algorithm. It can be implemented on any set of tasks. It can only be implemented on set of tasks having their burst time. It completely utilizes the CPU (even sometimes 100%). It may under-utilize the CPU. It increases the efficiency and throughput of the processor. It may decrease the efficiency and throughput of the processor. Comment More infoAdvertise with us Next Article Difference between EDF and LST CPU scheduling algorithms P pp_pankaj Follow Improve Article Tags : Operating Systems Difference Between CPU Scheduling Operating Systems-CPU Scheduling Similar Reads Operating System Tutorial An Operating System(OS) is a software that manages and handles hardware and software resources of a computing device. Responsible for managing and controlling all the activities and sharing of computer resources among different running applications.A low-level Software that includes all the basic fu 4 min read Types of Operating Systems Operating Systems can be categorized according to different criteria like whether an operating system is for mobile devices (examples Android and iOS) or desktop (examples Windows and Linux). Here, we are going to classify based on functionalities an operating system provides.8 Main Operating System 11 min read What is an Operating System? An Operating System is a System software that manages all the resources of the computing device. Acts as an interface between the software and different parts of the computer or the computer hardware. Manages the overall resources and operations of the computer. Controls and monitors the execution o 9 min read Difference Between IPv4 and IPv6 IPv4 and IPv6 are two versions of the system that gives devices a unique address on the internet, known as the Internet Protocol (IP). IP is like a set of rules that helps devices send and receive data online. Since the internet is made up of billions of connected devices, each one needs its own spe 7 min read CPU Scheduling in Operating Systems CPU scheduling is a process used by the operating system to decide which task or process gets to use the CPU at a particular time. This is important because a CPU can only handle one task at a time, but there are usually many tasks that need to be processed. The following are different purposes of a 8 min read Difference between BFS and DFS Breadth-First Search (BFS) and Depth-First Search (DFS) are two fundamental algorithms used for traversing or searching graphs and trees. This article covers the basic difference between Breadth-First Search and Depth-First Search.Difference between BFS and DFSParametersBFSDFSStands forBFS stands fo 2 min read Introduction of Deadlock in Operating System A deadlock is a situation where a set of processes is blocked because each process is holding a resource and waiting for another resource acquired by some other process. In this article, we will discuss deadlock, its necessary conditions, etc. in detail.Deadlock is a situation in computing where two 11 min read Page Replacement Algorithms in Operating Systems In an operating system that uses paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when a new page comes in. Page replacement becomes necessary when a page fault occurs and no free page frames are in memory. in this article, we will discus 7 min read Paging in Operating System Paging is the process of moving parts of a program, called pages, from secondary storage (like a hard drive) into the main memory (RAM). The main idea behind paging is to break a program into smaller fixed-size blocks called pages.To keep track of where each page is stored in memory, the operating s 8 min read Disk Scheduling Algorithms Disk scheduling algorithms are crucial in managing how data is read from and written to a computer's hard disk. These algorithms help determine the order in which disk read and write requests are processed, significantly impacting the speed and efficiency of data access. Common disk scheduling metho 12 min read Like