Difference between Priority Scheduling and Longest Job First (LJF) Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report 1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number of resources required, time needed etc. whereas external priorities are based upon the time in which the work is needed or the amount being paid for the work done or the importance of process. Priority scheduling can be preemptive or non- preemptive. Note - If two processes have the same priority then tie is broken using FCFS. The waiting time for the highest priority process is always zero in preemptive mode while it may not be zero in case of non preemptive mode. Disadvantages: The major problem is the starvation or indefinite blocking. It may so happen that in stream of processes, the system keeps executing the high priority processes and the low priority processes never get executed. 2. Longest Job First : Longest Job First is a non-preemptive scheduling algorithm. This algorithm is based upon the burst time of the processes. The processes are put into the ready queue based on their burst times i.e. in a descending order of the burst times. As the name suggests this algorithm is based upon the fact that the process with the largest burst time is processed first. The burst time of only those processes is considered that have arrived in the system until that time. Its preemptive version is called Longest Remaining Time First (LRTF) algorithm. Note - If two processes have the same burst time then the tie is broken using FCFS i.e., the process that arrived first is processed first. Disadvantages- This algorithm gives very high average waiting time and average turn-around time for a given set of processes. This may lead to convoy effect. It may happen that a short process may never get executed and the system keeps on executing the longer processes. It reduces the processing speed and thus reduces the efficiency and utilisation of the system. The difference between Longest job first (LJF) and Priority Scheduling algorithm are as follows: Longest job first (LJF) Priority scheduling Longest Job First (LJF) executes the processes based upon their burst time i.e. in descending order of their burst times. Priority scheduling executes the processes based upon their priorities i.e. in descending order of their priorities. A process with higher priority is executed first. LJF is non-preemptive but its preemptive version is also there called Shortest Remaining Time First (SRTF) algorithm. Priority scheduling is both preemptive and non preemptive in nature. The average waiting time for given set of processes is quite long which reduces the effectiveness of the system. There is no idea of average waiting time and response time. A long process may never get executed and the system may keep executing the short processes. The problem of blocking of a process can be solved through aging which means to gradually increase the priority of a process after a fixed interval of time by a fixed number. Comment More infoAdvertise with us Next Article Difference between Multi Level Queue Scheduling (MLQ) and Longest Job First (LJF) M mohitg593 Follow Improve Article Tags : Operating Systems Difference Between GATE CS Operating Systems-CPU Scheduling Similar Reads Difference between Multi Level Queue Scheduling (MLQ) and Longest Job First (LJF) CPU scheduling is deciding which process or task on a computer system should be executed in the CPU at a given time. This also helps us control how many processes use the CPU at any particular period, hence optimizing the CPUâs usage. The main goal of CPU scheduling is to maximize CPU utilization an 4 min read Difference between Multi Level Queue Scheduling (MLQ) and Longest Job First (LJF) CPU scheduling is deciding which process or task on a computer system should be executed in the CPU at a given time. This also helps us control how many processes use the CPU at any particular period, hence optimizing the CPUâs usage. The main goal of CPU scheduling is to maximize CPU utilization an 4 min read Difference between FCFS and Priority CPU scheduling 1. First Come First Served (FCFS) : First Come First Served (FCFS) is the simplest type of algorithm. It is a non-preemptive algorithm i.e. the process cannot be interrupted once it starts executing. The FCFS is implemented with the help of a FIFO queue. The processes are put into the ready queue in 3 min read Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling 1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are 3 min read Difference between Multi Level Queue Scheduling (MLQ) and Shortest Job First 1. Multi Level Queue Scheduling (MLQ) : It is quite difficult to have just one queue and schedule all the processes. This is where multi level queue scheduling is used. In this the processes are divided into various classes depending upon the property of the processes such as system process, I/O pro 3 min read Difference between Multi Level Queue Scheduling (MLQ) and Priority Scheduling Queue Scheduling refers to the process of managing and organizing tasks (or processes) that need to be executed by a system. In an operating system, tasks are often placed in queues waiting for CPU to execute them. Queue scheduling helps the system decide which task to run next, and in what order, e 3 min read Like