SlideShare uma empresa Scribd logo
1 de 22
SCHEDULING
Scheduling is a method that is used to distribute valuable
computing resources, usually processor time, bandwidth and memory, to
the various processes, threads, data flows and applications that need them.
Scheduling is done to balance the load on the system and ensure
equal distribution of resources and give some prioritization according to
set rules.
This ensures that a computer system is able to serve all requests
and achieve a certain quality of service. Scheduling is also known as
process scheduling.
Types of
Scheduling
1. LONG TERM SCHEDULING
2. MEDIUM TERM SCHEDULING
3. SHORT TERM SCHEDULING
4. SCHEDULING CRETERIA
5. NON PREEMPTIVE SCHEDULING
6. PREEMPTIVE SCHEDULING
Long-term Scheduling
Long term scheduling is performed when a new process is
created.
It is shown in the figure below. If the number of ready
processes in the ready queue becomes very high, then there is a
overhead on the operating system (i.e., processor).
Once when admit a process or job, it becomes process and
is added to the queue for the short-term scheduler.
Medium-term Scheduling
Medium-term scheduling is a part of the swapping function.
When part of the main memory gets freed, the operating system looks
at the list of suspend ready processes, decides which one is to be
swapped in (depending on priority, memory and other resources
required, etc).
This scheduler works in close conjunction with the long-
term scheduler. It will perform the swapping-in function among the
swapped-out processes.
Medium-term scheduler executes some what more
frequently.
Short-term Scheduling
Short-term scheduler is also called as dispatcher. Short-term
scheduler is invoked whenever an event occurs, that may lead to the
interruption of the current running process.
For example clock interrupts, I/O interrupts, operating system
calls, signals, etc. Short-term scheduler executes most frequently.
It selects from among the processes that are ready to execute
and allocates the CPU to one of them.
It must select a new process for the CPU frequently. It must be
very fast.
Scheduling Criteria
Scheduling criteria is also called as scheduling methodology.
Key to multiprogramming is scheduling. Different CPU
scheduling algorithm have different properties.
The criteria used for comparing these algorithms include the
following:
1. CPU Utilization
2. Throughput
3. Turn a round time
4. Waiting time
5. Response time
6. Fairness
Scheduling Algorithms
Scheduling algorithms or scheduling policies are mainly
used for short-term scheduling. The main objective of short-term
scheduling is to allocate processor time in such a way as to
optimize one or more aspects of system behaviour.
For these scheduling algorithms assume only a single
processor is present.
Scheduling algorithms decide which of the processes in
the ready queue is to be allocated to the CPU is basis on the type
of scheduling policy and whether that policy is either preemptive
or non-preemptive.
Scheduling Algorthim:
1. First-come, first-served scheduling (FCFS) algorithm
2. Shortest Job First Scheduling (SJF) algorithm
3. Shortest Remaining time (SRT) algorithm
4. Non-pre-emptive priority Scheduling algorithm
5. Preemptive priority Scheduling algorithm
6. Round-Robin Scheduling algorithm
7. Highest Response Ratio Next (HRRN) algorithm
8. Multilevel Feedback Queue Scheduling algorithm
9. Multilevel Queue Scheduling algorithm
Non-pre-emptive Scheduling :
In non-preemptive mode, once if a process enters into
running state, it continues to execute until it terminates or blocks
itself to wait for Input/Output or by requesting some operating
system service.
Preemptive Scheduling :
In preemptive mode, currently running process may be
interrupted and moved to the ready State by the operating
system.
When a new process arrives or when an interrupt
occurs, preemptive policies may incur greater overhead than non-
preemptive version but preemptive version may provide better
service.
First-come First-served Scheduling (FCFS)
First-come First-served Scheduling follow first in first out
method.
As each process becomes ready, it joins the ready queue.
When the current running process ceases to execute, the oldest process
in the Ready queue is selected for running.
That is first entered process among the available processes in
the ready queue.The average waiting time for FCFS is often quite
long.
TURNAROUND TIME=WAITING TIME + SERVICE TIME
Advantages
Better for long processes
 Simple method (i.e., minimum
overhead on processor)
 No starvation
Disadvantages
 Convoy effect occurs. Even
very small process should wait
for its turn to come to utilize the
CPU. Short process behind
long process results in lower
CPU utilization.
 Through put is not emphasized.
Shortest Job First Scheduling (SJF)
This algorithm associates it each process the length of the next
CPU burst. Shortest-job-first scheduling is also called as shortest process
next (SPN).
If the next CPU bursts of two processes are the same then FCFS
scheduling is used to break the tie.
SJF can be preemptive or non-preemptive.
A preemptive SJF algorithm will preempt the currently executing
process if the next CPU burst of newly arrived process may be shorter than
what is left to the currently executing process.
A Non-preemptive SJF algorithm will allow the currently running
process to finish. Preemptive SJF Scheduling is sometimes called Shortest
Remaining Time First algorithm.
Priority Scheduling
The SJF is a special case of general priority scheduling
algorithm.
A Priority (an integer) is associated with each process . The CPU
is allocated to the process with the highest priority . Generally smallest
integer is considered as the highest priority.
Non-preemptive priority scheduling
In this type of scheduling the CPU is allocated to the process
with the highest priority after completing the present running process.
Preemptive Priority Scheduling
In this type of scheduling the CPU is allocated to the
process With the highest priority immediately upon the arrival of
the highest priority process.
If the equal priority process is in running state, after the
completion of the present running process CPU is allocated to this
even though one more equal priority process is to arrive.
Round-Robin Scheduling
This type of scheduling algorithm is basically designed
for time sharing system.
It is similar to FCFS with preemption added. Round-
Robin Scheduling is also called as time-slicing scheduling and it is
a preemptive version based on a clock.
That is a clock interrupt is generated at periodic intervals
usually 10-100ms. When the interrupt occurs, the currently running
process is placed in the ready queue and the next ready job is
selected on a First-come, First-serve basis.
This process is known as time-slicing, because each
process is given a slice of time before being preempted.
RR Scheduling:
If there are n processes in the ready queue and time
quantum is q, then each process gets 1/n of the CPU time in
chunks of at most q time units at once.
No process waits for more than (n-1)*q time units until
the next time quantum.
The performance of RR depends on time slice. If it is
large then it is the same as FCFS. If q is small then overhead is
too high.
Shortest process next (SPN)
Non-pre emptive Assume that the execution time of a program
can be accurately estimated in advance.
Then a suitable selection criterion is to always pick the shortest
process, because in this way throughput is obviously maximised.
As obviously, there's a risk of starvation for long processes, and
they experience sluggish response times anyway.
A difficulty with this method is that the execution time must be
estimated as accurately as possible in advance: if too short a time is
specified the scheduler might abort the job.
Shortest Remaining Time (SRT)
Preemptive version of shortest process next policy . Must
estimate processing time.
Feed back Scheduling Performance:
SPN, SRT and HRRN require that something is known about
the execution times – e.g., expected execution time
Alternative policies – give preference to shorter tasks by
penalizing tasks that have been running longer
Use multiple queues, pushing tasks to the next queue
after each preemption
Scheduling

Mais conteúdo relacionado

Mais procurados

OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 
Operating System-Types-Examples-Advantages & disadvantages
Operating System-Types-Examples-Advantages & disadvantagesOperating System-Types-Examples-Advantages & disadvantages
Operating System-Types-Examples-Advantages & disadvantagesOPTOM Nimra Murtaza
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxLECO9
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)nikeAthena
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingVaibhav Khanna
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lockKaram Munir Butt
 
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronizationShakshi Ranawat
 
MULTILEVEL QUEUE SCHEDULING
MULTILEVEL QUEUE SCHEDULINGMULTILEVEL QUEUE SCHEDULING
MULTILEVEL QUEUE SCHEDULINGgarishma bhatia
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlocksangrampatil81
 

Mais procurados (20)

Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Deadlock
DeadlockDeadlock
Deadlock
 
Operating System-Types-Examples-Advantages & disadvantages
Operating System-Types-Examples-Advantages & disadvantagesOperating System-Types-Examples-Advantages & disadvantages
Operating System-Types-Examples-Advantages & disadvantages
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
 
BANKER'S ALGORITHM
BANKER'S ALGORITHMBANKER'S ALGORITHM
BANKER'S ALGORITHM
 
Semaphores
SemaphoresSemaphores
Semaphores
 
Context switching
Context switchingContext switching
Context switching
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor scheduling
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
 
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronization
 
scheduling
schedulingscheduling
scheduling
 
MULTILEVEL QUEUE SCHEDULING
MULTILEVEL QUEUE SCHEDULINGMULTILEVEL QUEUE SCHEDULING
MULTILEVEL QUEUE SCHEDULING
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 

Semelhante a Scheduling

LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesmanideepakc
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process SchedulingShipra Swati
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.pptKeyreSebre
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System SchedulingVishnu Prasad
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptxjamilaltiti1
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)Harshit Jain
 
cospptagain.pptx
cospptagain.pptxcospptagain.pptx
cospptagain.pptxRaunakJha15
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfRakibul Rakib
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithmsPaurav Shah
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .nathansel1
 

Semelhante a Scheduling (20)

LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processes
 
Osy ppt - Copy.pptx
Osy ppt - Copy.pptxOsy ppt - Copy.pptx
Osy ppt - Copy.pptx
 
cpu scheduling.pdf
cpu scheduling.pdfcpu scheduling.pdf
cpu scheduling.pdf
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
scheduling.pptx
scheduling.pptxscheduling.pptx
scheduling.pptx
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
cospptagain.pptx
cospptagain.pptxcospptagain.pptx
cospptagain.pptx
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdf
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
cosppt.pptx
cosppt.pptxcosppt.pptx
cosppt.pptx
 
ch_scheduling (1).ppt
ch_scheduling (1).pptch_scheduling (1).ppt
ch_scheduling (1).ppt
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 

Mais de pradeepa velmurugan (10)

FIREWALL
FIREWALLFIREWALL
FIREWALL
 
Multimedia compression
Multimedia compressionMultimedia compression
Multimedia compression
 
software design
software designsoftware design
software design
 
DIVIDE AND CONQUER
DIVIDE AND CONQUERDIVIDE AND CONQUER
DIVIDE AND CONQUER
 
IMAGE COMPRESSION
IMAGE COMPRESSIONIMAGE COMPRESSION
IMAGE COMPRESSION
 
File handling in input and output
File handling in input and outputFile handling in input and output
File handling in input and output
 
Analysis Of Attribute Revelance
Analysis Of Attribute RevelanceAnalysis Of Attribute Revelance
Analysis Of Attribute Revelance
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Data storage and indexing
Data storage and indexingData storage and indexing
Data storage and indexing
 
Research Methodology
Research MethodologyResearch Methodology
Research Methodology
 

Último

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 

Último (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

Scheduling

  • 2. Scheduling is a method that is used to distribute valuable computing resources, usually processor time, bandwidth and memory, to the various processes, threads, data flows and applications that need them. Scheduling is done to balance the load on the system and ensure equal distribution of resources and give some prioritization according to set rules. This ensures that a computer system is able to serve all requests and achieve a certain quality of service. Scheduling is also known as process scheduling.
  • 4. 1. LONG TERM SCHEDULING 2. MEDIUM TERM SCHEDULING 3. SHORT TERM SCHEDULING 4. SCHEDULING CRETERIA 5. NON PREEMPTIVE SCHEDULING 6. PREEMPTIVE SCHEDULING
  • 5. Long-term Scheduling Long term scheduling is performed when a new process is created. It is shown in the figure below. If the number of ready processes in the ready queue becomes very high, then there is a overhead on the operating system (i.e., processor). Once when admit a process or job, it becomes process and is added to the queue for the short-term scheduler.
  • 6. Medium-term Scheduling Medium-term scheduling is a part of the swapping function. When part of the main memory gets freed, the operating system looks at the list of suspend ready processes, decides which one is to be swapped in (depending on priority, memory and other resources required, etc). This scheduler works in close conjunction with the long- term scheduler. It will perform the swapping-in function among the swapped-out processes. Medium-term scheduler executes some what more frequently.
  • 7. Short-term Scheduling Short-term scheduler is also called as dispatcher. Short-term scheduler is invoked whenever an event occurs, that may lead to the interruption of the current running process. For example clock interrupts, I/O interrupts, operating system calls, signals, etc. Short-term scheduler executes most frequently. It selects from among the processes that are ready to execute and allocates the CPU to one of them. It must select a new process for the CPU frequently. It must be very fast.
  • 8. Scheduling Criteria Scheduling criteria is also called as scheduling methodology. Key to multiprogramming is scheduling. Different CPU scheduling algorithm have different properties. The criteria used for comparing these algorithms include the following: 1. CPU Utilization 2. Throughput 3. Turn a round time 4. Waiting time 5. Response time 6. Fairness
  • 9. Scheduling Algorithms Scheduling algorithms or scheduling policies are mainly used for short-term scheduling. The main objective of short-term scheduling is to allocate processor time in such a way as to optimize one or more aspects of system behaviour. For these scheduling algorithms assume only a single processor is present. Scheduling algorithms decide which of the processes in the ready queue is to be allocated to the CPU is basis on the type of scheduling policy and whether that policy is either preemptive or non-preemptive.
  • 10. Scheduling Algorthim: 1. First-come, first-served scheduling (FCFS) algorithm 2. Shortest Job First Scheduling (SJF) algorithm 3. Shortest Remaining time (SRT) algorithm 4. Non-pre-emptive priority Scheduling algorithm 5. Preemptive priority Scheduling algorithm 6. Round-Robin Scheduling algorithm 7. Highest Response Ratio Next (HRRN) algorithm 8. Multilevel Feedback Queue Scheduling algorithm 9. Multilevel Queue Scheduling algorithm
  • 11. Non-pre-emptive Scheduling : In non-preemptive mode, once if a process enters into running state, it continues to execute until it terminates or blocks itself to wait for Input/Output or by requesting some operating system service. Preemptive Scheduling : In preemptive mode, currently running process may be interrupted and moved to the ready State by the operating system. When a new process arrives or when an interrupt occurs, preemptive policies may incur greater overhead than non- preemptive version but preemptive version may provide better service.
  • 12. First-come First-served Scheduling (FCFS) First-come First-served Scheduling follow first in first out method. As each process becomes ready, it joins the ready queue. When the current running process ceases to execute, the oldest process in the Ready queue is selected for running. That is first entered process among the available processes in the ready queue.The average waiting time for FCFS is often quite long. TURNAROUND TIME=WAITING TIME + SERVICE TIME
  • 13. Advantages Better for long processes  Simple method (i.e., minimum overhead on processor)  No starvation Disadvantages  Convoy effect occurs. Even very small process should wait for its turn to come to utilize the CPU. Short process behind long process results in lower CPU utilization.  Through put is not emphasized.
  • 14. Shortest Job First Scheduling (SJF) This algorithm associates it each process the length of the next CPU burst. Shortest-job-first scheduling is also called as shortest process next (SPN). If the next CPU bursts of two processes are the same then FCFS scheduling is used to break the tie. SJF can be preemptive or non-preemptive. A preemptive SJF algorithm will preempt the currently executing process if the next CPU burst of newly arrived process may be shorter than what is left to the currently executing process. A Non-preemptive SJF algorithm will allow the currently running process to finish. Preemptive SJF Scheduling is sometimes called Shortest Remaining Time First algorithm.
  • 15. Priority Scheduling The SJF is a special case of general priority scheduling algorithm. A Priority (an integer) is associated with each process . The CPU is allocated to the process with the highest priority . Generally smallest integer is considered as the highest priority. Non-preemptive priority scheduling In this type of scheduling the CPU is allocated to the process with the highest priority after completing the present running process.
  • 16. Preemptive Priority Scheduling In this type of scheduling the CPU is allocated to the process With the highest priority immediately upon the arrival of the highest priority process. If the equal priority process is in running state, after the completion of the present running process CPU is allocated to this even though one more equal priority process is to arrive.
  • 17. Round-Robin Scheduling This type of scheduling algorithm is basically designed for time sharing system. It is similar to FCFS with preemption added. Round- Robin Scheduling is also called as time-slicing scheduling and it is a preemptive version based on a clock. That is a clock interrupt is generated at periodic intervals usually 10-100ms. When the interrupt occurs, the currently running process is placed in the ready queue and the next ready job is selected on a First-come, First-serve basis. This process is known as time-slicing, because each process is given a slice of time before being preempted.
  • 18. RR Scheduling: If there are n processes in the ready queue and time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits for more than (n-1)*q time units until the next time quantum. The performance of RR depends on time slice. If it is large then it is the same as FCFS. If q is small then overhead is too high.
  • 19. Shortest process next (SPN) Non-pre emptive Assume that the execution time of a program can be accurately estimated in advance. Then a suitable selection criterion is to always pick the shortest process, because in this way throughput is obviously maximised. As obviously, there's a risk of starvation for long processes, and they experience sluggish response times anyway. A difficulty with this method is that the execution time must be estimated as accurately as possible in advance: if too short a time is specified the scheduler might abort the job.
  • 20. Shortest Remaining Time (SRT) Preemptive version of shortest process next policy . Must estimate processing time.
  • 21. Feed back Scheduling Performance: SPN, SRT and HRRN require that something is known about the execution times – e.g., expected execution time Alternative policies – give preference to shorter tasks by penalizing tasks that have been running longer Use multiple queues, pushing tasks to the next queue after each preemption