SlideShare a Scribd company logo
2
Most read
5
Most read
8
Most read
SCHEDULING
ALGORITHMS
PREPARED BY : DHAVAL SAKHIYA(13CSE533)
PRAKASH ASADIYA(13CSE501)
What is scheduling?
 One CPU with a number of processes. Only one process
can use the CPU at a time which process is going to be
execute that thing decide a by scheduler and it’s whole
thing is called scheduling.
Two types of scheduling:
1. Preemptive
2.Non- Preemptive
Preemptive :
i. In preemptive scheduling, the currently running process may be
interrupted and move to the ready state by OS(forcefully).
ii. It selects a process and lets it run for a specific time duration,
called time quantum.
iii. If process is still running at the end of the time interval, it is
suspended and the scheduler selects another process to run.
Non-Preemptive :
i. In non-preemptive scheduling, the running process can only
lose the processor voluntarily by terminating or by requesting
and I/O. OR, once CPU given to a process it can not be
preempted until the process completes its CPU burst.
ii. It selects a process to run and then just lets it run until it
blocks or terminates.
Types of scheduler
 Long-term scheduler:
 load a job in memory
 Runs infrequently
 Medium-term scheduler:
 Select ready process to run on CPU
 Should be fast
 Short-term scheduler:
 Reduce multiprogramming or memory consumption
Process Scheduling
• “process” and “thread” used interchangeably
• Which process to run next
• Many processes in “ready” state
New Ready Running Exit
Waiting
FORMULA :
 TURN AROUND TIME:
 TAT=(Waiting Time)(W.T) + (Burst Time)(B.T)
 OR
 = (Completion Time)(C.T) – (Arrival Time)(AT)
 WAITING TIME:
 WT=(Turn Around Time)(TAT) – (Burst Time)(B.T)
 OR
 =(Completion Time)(C.T) – (Arrival Time)(A.T) – (Burst Time)(B.T)
First-Come First-Serve (FCFS)
 One ready queue;
 OS runs the process at head of the queue;
 New processes come in at the end of the queue;
 Running process does not give up the CPU until it terminates
or it performs IO.
SCHEDULING ALGORITHMS
Shortest Job First (SJF)
 Best approach to minimize waiting time.
 Impossible to implement.
 Processer should know in advance how much time process will take.
 SJF is optimal – gives minimum average waiting time for a given set of processes.
Process Arrival Time Burst Time
P1 0 7
P2 2 4
P3 4 1
P4 5 4
 SJF (non-preemptive):
0 7 8 12 16
P1 P2 P3 P2 P4 P1
Example of Preemptive SJF
Process Arrival Time Burst Time
P1 0 7
P2 2 4
P3 4 1
P4 5 4
SJF (preemptive)
0 2 4 5 7 11 16
Round Robin Scheduling
 Each process is provided a fix time to execute called quantum.
 Once a process is executed for given time period. Process is preempted and
other process executes for given time period.
 Context switching is used to save states of preempted processes.
SCHEDULING ALGORITHMS
Priority Based Scheduling
 Each process is assigned a priority. Process with highest priority is to be executed first and so on.
 Processes with same priority are executed on first come first serve basis.
 Priority can be decided based on memory requirements, time requirements or any other
resource requirement.
Priority based non pre-preemptive Algo Example
0
P4 P2 P1 P3
6 9 14 17
SCHEDULING ALGORITHMS

More Related Content

PPTX
Process scheduling
PPTX
CPU Scheduling in OS Presentation
PPT
CPU Scheduling Algorithms
PPT
Scheduling algorithms
PPTX
cpu scheduling
PPTX
Cpu scheduling in operating System.
PPTX
Cpu scheduling
PDF
6 cpu scheduling
Process scheduling
CPU Scheduling in OS Presentation
CPU Scheduling Algorithms
Scheduling algorithms
cpu scheduling
Cpu scheduling in operating System.
Cpu scheduling
6 cpu scheduling

What's hot (20)

PPTX
MULTILEVEL QUEUE SCHEDULING
PDF
Process scheduling (CPU Scheduling)
PPT
Memory Management in OS
PDF
Memory management
PPTX
Process management os concept
PPTX
Deadlocks in operating system
PPTX
Memory Management in OS
PDF
OS - Process Concepts
PPTX
Operating system memory management
PPTX
Church Turing Thesis
PPTX
Process scheduling
PPTX
Demand paging
PPTX
Operating system components
PPTX
Process in operating system
PPTX
Os unit 3 , process management
DOC
operating system lecture notes
PPTX
daa-unit-3-greedy method
MULTILEVEL QUEUE SCHEDULING
Process scheduling (CPU Scheduling)
Memory Management in OS
Memory management
Process management os concept
Deadlocks in operating system
Memory Management in OS
OS - Process Concepts
Operating system memory management
Church Turing Thesis
Process scheduling
Demand paging
Operating system components
Process in operating system
Os unit 3 , process management
operating system lecture notes
daa-unit-3-greedy method
Ad

Similar to SCHEDULING ALGORITHMS (20)

PPT
Process Scheduling in Ope Spptystems rating
PPT
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
PPTX
operating system scheduling concept lec2
PPTX
programming .pptx
PPTX
CPU Scheduling
PPT
Cpu scheduling
PPTX
CPU Scheduling Algorithms
PPTX
Preemptive process example.pptx
PPT
OS-operating systems- ch05 (CPU Scheduling) ...
PPTX
CPU Scheduling
PPTX
CPU SCHEDULING ALGORITHMS-FCFS,SJF,RR.pptx
PPT
Introduction of cpu scheduling in operating system
PPT
MODULE 2 for the cpu shcheduling and.ppt
PPTX
Chapter 3 - Operating System Scheduling.pptx
PPTX
LM10,11,12 - CPU SCHEDULING algorithms and its processes
PPTX
3Chapter Three- CPU Scheduling this is the best.pptx
PPT
Ch05 cpu-scheduling
PPT
Process management in os
PPTX
Cpu scheduling
PPT
Chapter No 4 CPU Scheduling and Algorithms.ppt
Process Scheduling in Ope Spptystems rating
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
operating system scheduling concept lec2
programming .pptx
CPU Scheduling
Cpu scheduling
CPU Scheduling Algorithms
Preemptive process example.pptx
OS-operating systems- ch05 (CPU Scheduling) ...
CPU Scheduling
CPU SCHEDULING ALGORITHMS-FCFS,SJF,RR.pptx
Introduction of cpu scheduling in operating system
MODULE 2 for the cpu shcheduling and.ppt
Chapter 3 - Operating System Scheduling.pptx
LM10,11,12 - CPU SCHEDULING algorithms and its processes
3Chapter Three- CPU Scheduling this is the best.pptx
Ch05 cpu-scheduling
Process management in os
Cpu scheduling
Chapter No 4 CPU Scheduling and Algorithms.ppt
Ad

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
UNIT 4 Total Quality Management .pptx
PPT
Project quality management in manufacturing
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
DOCX
573137875-Attendance-Management-System-original
PPTX
Welding lecture in detail for understanding
PPTX
Sustainable Sites - Green Building Construction
PDF
Digital Logic Computer Design lecture notes
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Well-logging-methods_new................
PDF
PPT on Performance Review to get promotions
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
UNIT 4 Total Quality Management .pptx
Project quality management in manufacturing
Foundation to blockchain - A guide to Blockchain Tech
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Lesson 3_Tessellation.pptx finite Mathematics
573137875-Attendance-Management-System-original
Welding lecture in detail for understanding
Sustainable Sites - Green Building Construction
Digital Logic Computer Design lecture notes
OOP with Java - Java Introduction (Basics)
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
CH1 Production IntroductoryConcepts.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Well-logging-methods_new................
PPT on Performance Review to get promotions

SCHEDULING ALGORITHMS

  • 1. SCHEDULING ALGORITHMS PREPARED BY : DHAVAL SAKHIYA(13CSE533) PRAKASH ASADIYA(13CSE501)
  • 2. What is scheduling?  One CPU with a number of processes. Only one process can use the CPU at a time which process is going to be execute that thing decide a by scheduler and it’s whole thing is called scheduling. Two types of scheduling: 1. Preemptive 2.Non- Preemptive
  • 3. Preemptive : i. In preemptive scheduling, the currently running process may be interrupted and move to the ready state by OS(forcefully). ii. It selects a process and lets it run for a specific time duration, called time quantum. iii. If process is still running at the end of the time interval, it is suspended and the scheduler selects another process to run.
  • 4. Non-Preemptive : i. In non-preemptive scheduling, the running process can only lose the processor voluntarily by terminating or by requesting and I/O. OR, once CPU given to a process it can not be preempted until the process completes its CPU burst. ii. It selects a process to run and then just lets it run until it blocks or terminates.
  • 5. Types of scheduler  Long-term scheduler:  load a job in memory  Runs infrequently  Medium-term scheduler:  Select ready process to run on CPU  Should be fast  Short-term scheduler:  Reduce multiprogramming or memory consumption
  • 6. Process Scheduling • “process” and “thread” used interchangeably • Which process to run next • Many processes in “ready” state New Ready Running Exit Waiting
  • 7. FORMULA :  TURN AROUND TIME:  TAT=(Waiting Time)(W.T) + (Burst Time)(B.T)  OR  = (Completion Time)(C.T) – (Arrival Time)(AT)  WAITING TIME:  WT=(Turn Around Time)(TAT) – (Burst Time)(B.T)  OR  =(Completion Time)(C.T) – (Arrival Time)(A.T) – (Burst Time)(B.T)
  • 8. First-Come First-Serve (FCFS)  One ready queue;  OS runs the process at head of the queue;  New processes come in at the end of the queue;  Running process does not give up the CPU until it terminates or it performs IO.
  • 10. Shortest Job First (SJF)  Best approach to minimize waiting time.  Impossible to implement.  Processer should know in advance how much time process will take.
  • 11.  SJF is optimal – gives minimum average waiting time for a given set of processes. Process Arrival Time Burst Time P1 0 7 P2 2 4 P3 4 1 P4 5 4  SJF (non-preemptive): 0 7 8 12 16
  • 12. P1 P2 P3 P2 P4 P1 Example of Preemptive SJF Process Arrival Time Burst Time P1 0 7 P2 2 4 P3 4 1 P4 5 4 SJF (preemptive) 0 2 4 5 7 11 16
  • 13. Round Robin Scheduling  Each process is provided a fix time to execute called quantum.  Once a process is executed for given time period. Process is preempted and other process executes for given time period.  Context switching is used to save states of preempted processes.
  • 15. Priority Based Scheduling  Each process is assigned a priority. Process with highest priority is to be executed first and so on.  Processes with same priority are executed on first come first serve basis.  Priority can be decided based on memory requirements, time requirements or any other resource requirement.
  • 16. Priority based non pre-preemptive Algo Example 0 P4 P2 P1 P3 6 9 14 17