SlideShare a Scribd company logo
Longest Remaining
Time First Scheduling
Algorithm
(LRTF)
Introduction
Longest Remaining Time First is a preemptive scheduling
algorithm. It is the converse of Shortest Remaining Time First
(SRTF) scheduling algorithm .
In this algorithm those processes schedules first which have the
longest burst time according to others.
Working procedure
• Step-1: Choose the process having least arrival time and
schedule it until next process’s arrives starts.
• Step-2: First check if the burst time of the next process is
greater then the first one then schedule the next process
otherwise schedule the first one.
• Step-3: Repeat the above both steps until execute all the
processes.
Example
Consider the following example:
Process Arrival-time (AT) Burst-time(BT)
P1 0 7
P2 1 3
P3 3 4
Gantt chart:
Summary:
Average waiting time = 7.33.
Average Turnaround time = 11.6
Process AT BT CT TAT WT
P1 0 7 12 12 5
P2 1 3 13 12 9
P3 3 4 14 11 8
Explanation:
• At the 0th unit of the CPU, there is only one process that is P1, so P1
gets executed for the 1 time unit.
• At the 1st unit of the CPU, Process P2 arrives. Now, the P1 needs 6
more units more to be executed, and the P2 needs only 3 units.
So, P1 is executed first by preempting P2.
• At the 3rd unit of time, the process P3 arrives, and the burst time of
P3 is 4 units which is more than the P2 but equal to P1 so P1
executes first.
• Now at time unit 4 the burst time of P3 is 4 units that means it
longest so P3 got executed.
• At time unit 5 all the process need 3 unit for completion but P1
arrives first So again, P1 is sent for execution, then P2 and then P3
and so on the whole process continues until all process got
executed.
Advantages
• LRTF algorithm is simple and easy to implement.
• Almost all the processes complete by the time the longest job
reaches its completion.
• Starvation-free as all processes get fair share of CPU.
Disadvantages
• The context switch consumes CPU’s valuable time which can
be utilized for executing processes.
• Smaller processes need to wait for CPU to finish larger burst
size processes.
• The average waiting time and average turn-around time are
much high even with much less burst time of each process.
Comparison with SRTF
scheduler:
Gantt charts:
LRTF:
SRTF:
CONTINUES…
Summary comparison:
LRTF:
SRTF:
CONTINUES…
LRTF:
Average waiting time = 7.33.
Average Turnaround time = 11.6.
SRTF:
Average waiting time = 2.66.
Average Turnaround time = 7.33.

More Related Content

What's hot

Unit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process SynchronizationUnit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process Synchronization
cscarcas
 
Turing machine-TOC
Turing machine-TOCTuring machine-TOC
Turing machine-TOC
Maulik Togadiya
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
Rajendran
 
Easy Tutorial Step-by-Step How to use Airolib-ng
Easy Tutorial Step-by-Step How to use Airolib-ngEasy Tutorial Step-by-Step How to use Airolib-ng
Easy Tutorial Step-by-Step How to use Airolib-ng
Tisya Ka
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
Shubhashish Punj
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
Mukesh Chinta
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Model
sohailsaif
 
Operating System Unit 1
Operating System Unit 1Operating System Unit 1
Operating System Unit 1
SanthiNivas
 
3.4 deterministic pda
3.4 deterministic pda3.4 deterministic pda
3.4 deterministic pda
Sampath Kumar S
 
802.11i
802.11i802.11i
802.11i
akruthi k
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
hashim102
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
LOKENDRA PRAJAPATI
 
Operating System
Operating SystemOperating System
Operating System
Griffinder VinHai
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
Ra'Fat Al-Msie'deen
 
Disk Scheduling Algorithms
Disk Scheduling AlgorithmsDisk Scheduling Algorithms
Disk Scheduling Algorithms
ali jawad
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"
Ra'Fat Al-Msie'deen
 
Monitors
MonitorsMonitors
Monitors
Mohd Arif
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
myrajendra
 
Memory consistency models and basics
Memory consistency models and basicsMemory consistency models and basics
Memory consistency models and basics
Ramdas Mozhikunnath
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 

What's hot (20)

Unit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process SynchronizationUnit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process Synchronization
 
Turing machine-TOC
Turing machine-TOCTuring machine-TOC
Turing machine-TOC
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Easy Tutorial Step-by-Step How to use Airolib-ng
Easy Tutorial Step-by-Step How to use Airolib-ngEasy Tutorial Step-by-Step How to use Airolib-ng
Easy Tutorial Step-by-Step How to use Airolib-ng
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Model
 
Operating System Unit 1
Operating System Unit 1Operating System Unit 1
Operating System Unit 1
 
3.4 deterministic pda
3.4 deterministic pda3.4 deterministic pda
3.4 deterministic pda
 
802.11i
802.11i802.11i
802.11i
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
 
Operating System
Operating SystemOperating System
Operating System
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 
Disk Scheduling Algorithms
Disk Scheduling AlgorithmsDisk Scheduling Algorithms
Disk Scheduling Algorithms
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"
 
Monitors
MonitorsMonitors
Monitors
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
 
Memory consistency models and basics
Memory consistency models and basicsMemory consistency models and basics
Memory consistency models and basics
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 

Similar to LRTF.pptx

OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
Kp Sharma
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
KeyreSebre
 
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILEDCPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
VADAPALLYPRAVEENKUMA1
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
mohsinalilarik1
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
Amir Khan
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdf
Rakibul Rakib
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
M. Abdullah Wasif
 
Program for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docxProgram for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docx
AbdulraufKhan29
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
A. S. M. Shafi
 
programming .pptx
programming .pptxprogramming .pptx
programming .pptx
SHUJEHASSAN
 
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round RobinComparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Universitas Pembangunan Panca Budi
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
harini0810
 
Cpu Schedule Algorithm
Cpu Schedule AlgorithmCpu Schedule Algorithm
Cpu Schedule Algorithm
Archit Jain
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
Shipra Swati
 
exp 3.docx
exp 3.docxexp 3.docx
exp 3.docx
Ganesh Chavan
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
Paurav Shah
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
Farhat Shaikh
 
cospptagain.pptx
cospptagain.pptxcospptagain.pptx
cospptagain.pptx
RaunakJha15
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - Engineering
Yogesh Santhan
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
Prakash Sir
 

Similar to LRTF.pptx (20)

OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILEDCPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdf
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Program for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docxProgram for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docx
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
 
programming .pptx
programming .pptxprogramming .pptx
programming .pptx
 
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round RobinComparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
Cpu Schedule Algorithm
Cpu Schedule AlgorithmCpu Schedule Algorithm
Cpu Schedule Algorithm
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
exp 3.docx
exp 3.docxexp 3.docx
exp 3.docx
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
cospptagain.pptx
cospptagain.pptxcospptagain.pptx
cospptagain.pptx
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - Engineering
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 

Recently uploaded

Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 

Recently uploaded (20)

Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 

LRTF.pptx

  • 1. Longest Remaining Time First Scheduling Algorithm (LRTF)
  • 2. Introduction Longest Remaining Time First is a preemptive scheduling algorithm. It is the converse of Shortest Remaining Time First (SRTF) scheduling algorithm . In this algorithm those processes schedules first which have the longest burst time according to others.
  • 3. Working procedure • Step-1: Choose the process having least arrival time and schedule it until next process’s arrives starts. • Step-2: First check if the burst time of the next process is greater then the first one then schedule the next process otherwise schedule the first one. • Step-3: Repeat the above both steps until execute all the processes.
  • 4. Example Consider the following example: Process Arrival-time (AT) Burst-time(BT) P1 0 7 P2 1 3 P3 3 4
  • 5. Gantt chart: Summary: Average waiting time = 7.33. Average Turnaround time = 11.6 Process AT BT CT TAT WT P1 0 7 12 12 5 P2 1 3 13 12 9 P3 3 4 14 11 8
  • 6. Explanation: • At the 0th unit of the CPU, there is only one process that is P1, so P1 gets executed for the 1 time unit. • At the 1st unit of the CPU, Process P2 arrives. Now, the P1 needs 6 more units more to be executed, and the P2 needs only 3 units. So, P1 is executed first by preempting P2. • At the 3rd unit of time, the process P3 arrives, and the burst time of P3 is 4 units which is more than the P2 but equal to P1 so P1 executes first. • Now at time unit 4 the burst time of P3 is 4 units that means it longest so P3 got executed. • At time unit 5 all the process need 3 unit for completion but P1 arrives first So again, P1 is sent for execution, then P2 and then P3 and so on the whole process continues until all process got executed.
  • 7. Advantages • LRTF algorithm is simple and easy to implement. • Almost all the processes complete by the time the longest job reaches its completion. • Starvation-free as all processes get fair share of CPU.
  • 8. Disadvantages • The context switch consumes CPU’s valuable time which can be utilized for executing processes. • Smaller processes need to wait for CPU to finish larger burst size processes. • The average waiting time and average turn-around time are much high even with much less burst time of each process.
  • 11. CONTINUES… LRTF: Average waiting time = 7.33. Average Turnaround time = 11.6. SRTF: Average waiting time = 2.66. Average Turnaround time = 7.33.