SlideShare a Scribd company logo
2
Most read
9
Most read
11
Most read
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

More Related Content

PPTX
Process scheduling
PPTX
Floating point representation
PPTX
SCHEDULING ALGORITHMS
PPTX
Cpu scheduling in operating System.
PDF
Process scheduling (CPU Scheduling)
PPTX
Ch1-Operating System Concepts
PDF
Floating point presentation
DOCX
project on football for physical education
Process scheduling
Floating point representation
SCHEDULING ALGORITHMS
Cpu scheduling in operating System.
Process scheduling (CPU Scheduling)
Ch1-Operating System Concepts
Floating point presentation
project on football for physical education

What's hot (20)

PPTX
CPU Scheduling in OS Presentation
PPT
Scheduling algorithms
PPTX
Deadlock ppt
PPT
Operating system services 9
PPTX
Staffing level estimation
PPTX
Operating system components
PDF
Software Engineering : Requirement Analysis & Specification
PPTX
serializability in dbms
PPT
Basic MIPS implementation
PPTX
Input-Buffering
PPTX
Process synchronization in Operating Systems
PPTX
MULTILEVEL QUEUE SCHEDULING
PPT
Introduction to System Calls
PPTX
Os unit 3 , process management
PPTX
Deadlocks in operating system
DOCX
Operating System Process Synchronization
PDF
Serializability
PPT
Operating Systems Process Scheduling Algorithms
PPT
Clock synchronization in distributed system
CPU Scheduling in OS Presentation
Scheduling algorithms
Deadlock ppt
Operating system services 9
Staffing level estimation
Operating system components
Software Engineering : Requirement Analysis & Specification
serializability in dbms
Basic MIPS implementation
Input-Buffering
Process synchronization in Operating Systems
MULTILEVEL QUEUE SCHEDULING
Introduction to System Calls
Os unit 3 , process management
Deadlocks in operating system
Operating System Process Synchronization
Serializability
Operating Systems Process Scheduling Algorithms
Clock synchronization in distributed system
Ad

Similar to Scheduling (20)

PPTX
LM10,11,12 - CPU SCHEDULING algorithms and its processes
PPTX
CPU Scheduling_in_processManagement.pptx
PPT
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
PPTX
Osy ppt - Copy.pptx
PDF
cpu scheduling.pdf
PPTX
CPU SCHEDULING ALGORITHMS-FCFS,SJF,RR.pptx
PDF
Operating System-Process Scheduling
PPT
Introduction of cpu scheduling in operating system
PPT
MODULE 2 for the cpu shcheduling and.ppt
PPTX
scheduling.pptx
PPTX
Cpu scheduling
PPT
chapter 5 CPU scheduling.ppt
PPTX
Scheduling Algorithm in System Designing.pptx
PPTX
topic cpu scheduling in operating system.pptx
PPT
Chapter No 4 CPU Scheduling and Algorithms.ppt
PPTX
2_CPU Scheduling (2)beautifulgameyt.pptx
PPT
Operating System Scheduling
PDF
Os unit 2
PPTX
Preemptive process example.pptx
PPTX
(CPU Scheduling) in operating systems.pptx
LM10,11,12 - CPU SCHEDULING algorithms and its processes
CPU Scheduling_in_processManagement.pptx
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
Osy ppt - Copy.pptx
cpu scheduling.pdf
CPU SCHEDULING ALGORITHMS-FCFS,SJF,RR.pptx
Operating System-Process Scheduling
Introduction of cpu scheduling in operating system
MODULE 2 for the cpu shcheduling and.ppt
scheduling.pptx
Cpu scheduling
chapter 5 CPU scheduling.ppt
Scheduling Algorithm in System Designing.pptx
topic cpu scheduling in operating system.pptx
Chapter No 4 CPU Scheduling and Algorithms.ppt
2_CPU Scheduling (2)beautifulgameyt.pptx
Operating System Scheduling
Os unit 2
Preemptive process example.pptx
(CPU Scheduling) in operating systems.pptx
Ad

More from pradeepa velmurugan (10)

PPT
PPT
Multimedia compression
PPTX
software design
PPTX
DIVIDE AND CONQUER
PPTX
IMAGE COMPRESSION
PPTX
File handling in input and output
PPTX
Analysis Of Attribute Revelance
PPTX
Instruction codes
PPTX
Data storage and indexing
PPT
Research Methodology
Multimedia compression
software design
DIVIDE AND CONQUER
IMAGE COMPRESSION
File handling in input and output
Analysis Of Attribute Revelance
Instruction codes
Data storage and indexing
Research Methodology

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Business Ethics Teaching Materials for college
PDF
Complications of Minimal Access Surgery at WLH
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Cell Types and Its function , kingdom of life
PPTX
Pharma ospi slides which help in ospi learning
PDF
01-Introduction-to-Information-Management.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Pre independence Education in Inndia.pdf
PDF
Classroom Observation Tools for Teachers
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Abdominal Access Techniques with Prof. Dr. R K Mishra
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial disease of the cardiovascular and lymphatic systems
VCE English Exam - Section C Student Revision Booklet
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPH.pptx obstetrics and gynecology in nursing
Business Ethics Teaching Materials for college
Complications of Minimal Access Surgery at WLH
TR - Agricultural Crops Production NC III.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Insiders guide to clinical Medicine.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Cell Types and Its function , kingdom of life
Pharma ospi slides which help in ospi learning
01-Introduction-to-Information-Management.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Pre independence Education in Inndia.pdf
Classroom Observation Tools for Teachers

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