SlideShare une entreprise Scribd logo
1  sur  26
CPU SCHEDULING

GUIDED BY:
MR. VENKATESWARAN.R (ASST.   PROFESSOR M.TECH)



CREATED BY:
VINOTH.J
SARAVANA KUMAR.R
KARTHICK SEKAR.S
ASIR ALLOSANAI GANA SEKAR
MUTHURAMALINGAM.E
MUNEESWARAN.M


INFANT JESUS COLLEGE OF ENGINEERING
OVERVIEW

 Basic Concepts
 Scheduling Criteria
 Scheduling Algorithms
 Multiple-Processor Scheduling
 Operating Systems Examples
OVERVIEW

 In computer science, scheduling is the method by
 which threads, processes or data flows are given
 access to system resources (e.g. processor time,
 communications bandwidth). This is usually done to
 load balance a system effectively or achieve a target
 quality of service.
OVERVIEW

 Throughput:
 No of processes that complete the execution per unit
  time
 Response time: Amount of time it takes from
  when a request was submitted until the first
  response is produced
 Waiting time:Amount of time a process has been
  waiting in the ready queue Response time = waiting
  time + execution time
Types of scheduling methods


 Preemptive scheduling:A higher priority process
  can preempt a currently running low priority process
  to avoid priority inversion
 Nonpreemptive scheduling:A higher priority
  process waits a currently running process to finish
  regardless of the priority e.g., FCFS
Types of scheduling methods

 Long and medium term scheduling
 Long term scheduling: which determines which
  programs are admitted to the system for execution
  and when, and which ones should be exited.
 Medium term scheduling: which determines when
  processes are to be suspended and resumed;
 Short term scheduling (or dispatching): which
  determines which of the ready processes can have
  CPU resources, and for how long.
Single Processor Scheduling Algorithms

 First Come, First Served (FCFS)
 Shortest Job First (SJF)
 Priority
 Round Robin (RR)
First Come, First Served (FCFS)


 First Come, First Served (FCFS), is the simplest
  scheduling algorithm, FIFO simply queues processes
  in the order that they arrive in the ready queue.
 Throughput can be low, since long processes can
  hold the CPU
 It is based on Queuing
 No prioritization occurs, thus this system has trouble
  meeting process deadlines.
Example
MERITS AND DEMERITS

 MERITS:Easy to understand and easy to program
 It is fair
 DEMERITS:
 Does not perform well in real systems
 Ignores the service time request and all other criteria
Shortest-Job-First (SJR) Scheduling

 1. non preemptive – once CPU given to the
  process it cannot be preempted until completes its
  CPU burst.
 2. preemptive – if a new process arrives with CPU
  burst length less than remaining time of current
  executing process, preempt. This scheme is know as
  the Shortest-Remaining-Time-First (SRTF).
 SJF is optimal – gives minimum average waiting
  time for a given set of processes.
Example
MERITS AND DEMERITS

 MERITS:
 SJF is optimal – gives minimum average waiting
    time for a given set of processes

 DEMERITS:
 Need to have a good heuristic to guess the next
  CPUexecution time
 Short duration processes will starve longer ones
Priority Scheduling

 The SJF algorithm is a special case of the general
  priority scheduling algorithm
 A priority number (integer) is associated with each
  process
 The CPU is allocated to the process with the highest
  priority (smallest integer = highest priority)
Example
MERITS AND DEMERITS

 MERITS:
 Simplicity
 Reasonable support for priority.
  Suitable for applications with varying time and resource
  requirements.

 DEMERITS:
 Indefinite blocking or starvation.

 A priority scheduling can leave some low priority waiting
  processes indefinitely for CPU.
Round Robin (RR)

 Each process gets a small unit of CPU time (time
  quantum), usually 10-100 milliseconds. After this
  time has elapsed, the process is preempted and
  added to the end of the ready queue.
 Performance
     1. q large _ FIFO
     2. q small _ q must be large with respect to
  context switch, otherwise overhead is too high.
Example
MERITS AND DEMERITS

 MERITS:
 Fair allocation of CPU across jobs
 Low average waiting time when job lengths vary
 DEMERITS:
 It is suitable for task with varied burst time. But for task
  with same time makes trouble.
Multilevel Queue Scheduling
Multilevel Feedback Queue

 A process can move between the various queues;
 Multilevel-feedback-queue scheduler defined by
 the following parameters:
 1. number of queues
 2. scheduling g algorithms for each queue
Example of Multilevel Feedback Queue


             Scheduling algorithm         CPU Overhead          Throughput     Turnaround time         Response time




             First In First Out     Low                  Low                 High                Low




             Shortest Job First     Medium               High                Medium              Medium




             Priority based
                                    Medium               Low                 High                High
             scheduling




             Round-robin scheduling High                 Medium              Medium              High




             Multilevel Queue
                                    High                 High                Medium              Medium
             scheduling
Multiprocessor Scheduling

 '' On a multiprocessor, scheduling is two
 dimensional. The scheduler has to decide which
 process to run and which CPU to run it on. This extra
 dimension greatly complicates scheduling on
 multiprocessors.
OPERATING SYSTEM EXAMPLES

 Windows
 Very early MS-DOS and Microsoft Windows systems
 were non-multitasking, and as such did not feature a
 scheduler. Windows 3.1x used a non-preemptive
 scheduler, meaning that it did not interrupt
 programs.
OPERATING SYSTEM EXAMPLES

 Mac OS
 Mac OS 9 uses cooperative scheduling for threads,
 where one process controls multiple cooperative
 threads, and also provides preemptive scheduling for
 MP tasks.
CONCLUSION

 The above mentioned are the various CPU
 scheduling used in the present day. These algorithms
 are inherited based on the recuirement of the
 processor.

Contenu connexe

Tendances

Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmAdeel Rasheed
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionBipul Chandra Kar
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithmsShanu Kumar
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithmssathish sak
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithmBinal Parekh
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating systemAli Haider
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsSachin Chauhan
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.MOHIT DADU
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 

Tendances (20)

Semaphores
SemaphoresSemaphores
Semaphores
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling Algorithm
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
scheduling
schedulingscheduling
scheduling
 
File system structure
File system structureFile system structure
File system structure
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
 
Operating System: Deadlock
Operating System: DeadlockOperating System: Deadlock
Operating System: Deadlock
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Semaphore
SemaphoreSemaphore
Semaphore
 

Similaire à CPU Scheduling Algorithms Overview

Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Shreya Kumar
 
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
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfRakibul Rakib
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.pptKeyreSebre
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)Harshit Jain
 
CPU scheduling in Operating System Explanation
CPU scheduling in Operating System ExplanationCPU scheduling in Operating System Explanation
CPU scheduling in Operating System ExplanationAnitaSofiaKeyser
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System SchedulingVishnu Prasad
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithmsPaurav Shah
 
Process management in os
Process management in osProcess management in os
Process management in osMiong Lazaro
 
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance IJECEIAES
 

Similaire à CPU Scheduling Algorithms Overview (20)

Scheduling
SchedulingScheduling
Scheduling
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
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
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdf
 
Operating system
Operating systemOperating system
Operating system
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
ch_scheduling (1).ppt
ch_scheduling (1).pptch_scheduling (1).ppt
ch_scheduling (1).ppt
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
CPU scheduling in Operating System Explanation
CPU scheduling in Operating System ExplanationCPU scheduling in Operating System Explanation
CPU scheduling in Operating System Explanation
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
PPT CPU
PPT CPUPPT CPU
PPT CPU
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
ERTS UNIT 5.pptx
ERTS UNIT 5.pptxERTS UNIT 5.pptx
ERTS UNIT 5.pptx
 
Process management in os
Process management in osProcess management in os
Process management in os
 
scheduling.pptx
scheduling.pptxscheduling.pptx
scheduling.pptx
 
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
Optimal Round Robin CPU Scheduling Algorithm using Manhattan Distance
 
Osy ppt - Copy.pptx
Osy ppt - Copy.pptxOsy ppt - Copy.pptx
Osy ppt - Copy.pptx
 

CPU Scheduling Algorithms Overview

  • 1. CPU SCHEDULING GUIDED BY: MR. VENKATESWARAN.R (ASST. PROFESSOR M.TECH) CREATED BY: VINOTH.J SARAVANA KUMAR.R KARTHICK SEKAR.S ASIR ALLOSANAI GANA SEKAR MUTHURAMALINGAM.E MUNEESWARAN.M INFANT JESUS COLLEGE OF ENGINEERING
  • 2. OVERVIEW  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Multiple-Processor Scheduling  Operating Systems Examples
  • 3. OVERVIEW  In computer science, scheduling is the method by which threads, processes or data flows are given access to system resources (e.g. processor time, communications bandwidth). This is usually done to load balance a system effectively or achieve a target quality of service.
  • 4. OVERVIEW  Throughput:  No of processes that complete the execution per unit time  Response time: Amount of time it takes from when a request was submitted until the first response is produced  Waiting time:Amount of time a process has been waiting in the ready queue Response time = waiting time + execution time
  • 5. Types of scheduling methods  Preemptive scheduling:A higher priority process can preempt a currently running low priority process to avoid priority inversion  Nonpreemptive scheduling:A higher priority process waits a currently running process to finish regardless of the priority e.g., FCFS
  • 6. Types of scheduling methods  Long and medium term scheduling  Long term scheduling: which determines which programs are admitted to the system for execution and when, and which ones should be exited.  Medium term scheduling: which determines when processes are to be suspended and resumed;  Short term scheduling (or dispatching): which determines which of the ready processes can have CPU resources, and for how long.
  • 7. Single Processor Scheduling Algorithms  First Come, First Served (FCFS)  Shortest Job First (SJF)  Priority  Round Robin (RR)
  • 8. First Come, First Served (FCFS)  First Come, First Served (FCFS), is the simplest scheduling algorithm, FIFO simply queues processes in the order that they arrive in the ready queue.  Throughput can be low, since long processes can hold the CPU  It is based on Queuing  No prioritization occurs, thus this system has trouble meeting process deadlines.
  • 10. MERITS AND DEMERITS  MERITS:Easy to understand and easy to program  It is fair  DEMERITS:  Does not perform well in real systems  Ignores the service time request and all other criteria
  • 11. Shortest-Job-First (SJR) Scheduling  1. non preemptive – once CPU given to the process it cannot be preempted until completes its CPU burst.  2. preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF).  SJF is optimal – gives minimum average waiting time for a given set of processes.
  • 13. MERITS AND DEMERITS  MERITS:  SJF is optimal – gives minimum average waiting time for a given set of processes   DEMERITS:  Need to have a good heuristic to guess the next CPUexecution time  Short duration processes will starve longer ones
  • 14. Priority Scheduling  The SJF algorithm is a special case of the general priority scheduling algorithm  A priority number (integer) is associated with each process  The CPU is allocated to the process with the highest priority (smallest integer = highest priority)
  • 16. MERITS AND DEMERITS  MERITS:  Simplicity  Reasonable support for priority. Suitable for applications with varying time and resource requirements.  DEMERITS:  Indefinite blocking or starvation.  A priority scheduling can leave some low priority waiting processes indefinitely for CPU.
  • 17. Round Robin (RR)  Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.  Performance  1. q large _ FIFO  2. q small _ q must be large with respect to context switch, otherwise overhead is too high.
  • 19. MERITS AND DEMERITS  MERITS:  Fair allocation of CPU across jobs  Low average waiting time when job lengths vary  DEMERITS:  It is suitable for task with varied burst time. But for task with same time makes trouble.
  • 21. Multilevel Feedback Queue  A process can move between the various queues;  Multilevel-feedback-queue scheduler defined by the following parameters:  1. number of queues  2. scheduling g algorithms for each queue
  • 22. Example of Multilevel Feedback Queue Scheduling algorithm CPU Overhead Throughput Turnaround time Response time First In First Out Low Low High Low Shortest Job First Medium High Medium Medium Priority based Medium Low High High scheduling Round-robin scheduling High Medium Medium High Multilevel Queue High High Medium Medium scheduling
  • 23. Multiprocessor Scheduling  '' On a multiprocessor, scheduling is two dimensional. The scheduler has to decide which process to run and which CPU to run it on. This extra dimension greatly complicates scheduling on multiprocessors.
  • 24. OPERATING SYSTEM EXAMPLES  Windows  Very early MS-DOS and Microsoft Windows systems were non-multitasking, and as such did not feature a scheduler. Windows 3.1x used a non-preemptive scheduler, meaning that it did not interrupt programs.
  • 25. OPERATING SYSTEM EXAMPLES  Mac OS  Mac OS 9 uses cooperative scheduling for threads, where one process controls multiple cooperative threads, and also provides preemptive scheduling for MP tasks.
  • 26. CONCLUSION  The above mentioned are the various CPU scheduling used in the present day. These algorithms are inherited based on the recuirement of the processor.