FOR FREE MATERIALS

Least Completed Next (LCN) scheduling

 

The LCN policy schedules the process that has consumed the least amount of CPU time.

 

Actually nature of a process, whether CPU-bound or I/O bound, and its CPU time requirement do not impact its progress in the scheduling system.

 

In this scheduling, all processes will make approximately equal progress in terms of the CPU time consumed by them.

 

Thus this scheduling policy guarantees that the short process will finish ahead of long processes.

 

The scheduler analyzes this information and selects the process that has yet consumed the least amount of CPU time.

 

In case of a tie, it selects the process that has not been serviced for the longest period of time.

 

Criteria: CPU Time (Burst Time)

Mode: Preemptive 

 

Let’s take an example for better understanding.

 

Example 1:

 

 

Gantt Chart as per Least Completed Next (LCN)

 

 

# Arrival time of P1 is 0 so, P1 can get a whereas chance to CPU first up to 2 units because at unit 2 P2 comes in the ready queue. Now, when we compare P1 and P2, P1 already consumed CPU 2 unit where as P2 not consume any unit of CPU, So preempted P1 and CPU assign to process P2.

 

# Same procedure carry on to whole scheduling method that is the process which yet not consume CPU or consume the least amount of CPU, will schedule first.

 

Number of Context Switches (CS): 13

 

Now we calculate Turn Around Time (TAT) and Waiting Time (WT) using the following formula:

 

TAT = CT - AT, WT = TAT – BT 

And

Response Time (RT) = FR (First Response) - AR (Arrival Time)

 

 

Note: The response time for LCN is 0 for all process.

 

Advantage:

i) Response time is the least compared to other schedules.

ii) Shorter process finished first.

iii) Prediction of Burst time is not required like SJF, SRTF, and HRRN.

 

Disadvantage:

i) This policy has the familiar drawback of starving long processes of CPU attention.

ii) Time wastage for context switching is expensive.