SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
Process Scheduling




                                  Abhishek Nagar


Process Scheduling                          -Abhishek Nagar
Agenda

        Introduction
        The Basics (Keywords)
        Scheduling Policies
        Scheduling Algorithms
              First Come First Served
              Shortest Job First
              Round Robin
              Priority




Process Scheduling                      -Abhishek Nagar
Introduction


            In multiprogramming systems, when there is more
                   than one ready process, the operating
              system must decide which one to activate. The
           decision is made by the part of the operating system
            called the scheduler, using a scheduling algorithm.


           The scheduler is concerned with deciding policy, not
                        providing a mechanism



Process Scheduling                                           -Abhishek Nagar
The Basics (Keywords)


        Process
        CPU Burst (Usage Time)
        Turnaround Time
        Waiting Time
        Time Quantum (time slice)




Process Scheduling                           -Abhishek Nagar
Scheduling Policies



        Preemptive
        Non Preemptive




Process Scheduling                         -Abhishek Nagar
First Come First Served



           FCFS, also known as First-In-First-Out (FIFO), is the
           simplest scheduling policy. Arriving jobs are inserted
               into the tail (rear) of the ready queue and the
             process to be executed next is removed from the
                          head (front) of the queue.




Process Scheduling                                             -Abhishek Nagar
FCFS - Example
                                     Process CPU Turnaround Waiting
                                             Burst  Time     Time
                                        A     10     10        0
       Process                          B     1      11       10
                                        C     3      14       11
                                        D     4      18       14
                                                    13.25    8.75
                                     AVERAGE

        D
        C
        B
        A


                     5     10   15          20        25    Time

Process Scheduling                                            -Abhishek Nagar
Shortest Job First



                    SJF policy selects the job with the shortest
                 (expected) processing time first. Shorter jobs are
                        always executed before long jobs.

                     long running jobs may starve, because the CPU
                            has a steady supply of short jobs.




Process Scheduling                                                    -Abhishek Nagar
Shortest Job First - Example
                                   Process CPU Turnaround Waiting
                                           Burst  Time     Time
       Process                        A     10      18       8
                                      B     1       1        0
                                      C     3       4        1
                                      D     4       8        4
                                                   7.75    3.25
                                   AVERAGE
        D
        C
        B
        A


                     5   10   15         20        25    Time

Process Scheduling                                          -Abhishek Nagar
Round Robin


                RR reduces the penalty that short jobs suffer with
               FCFS by preempting running jobs periodically. The
                CPU suspends the current job when the reserved
               quantum (time-slice) is exhausted. The job is then
                  put at the end of the ready queue if not yet
                                  completed.




Process Scheduling                                                   -Abhishek Nagar
Round Robin - example
                                                  Time Slice = 1
    Process                             Process CPU Turnaround Waiting
                                                Burst     Time   Time
                                           A     10        18      8
                                           B     1          2      1
                                           C     3          9      6
                                           D     4         12      6
     D                                                    10.25  5.75
                                        AVERAGE

     C
     B
     A


                  5       10         15       20       25 Time
              Ready Queue Status : A B C D A C D A C D A D A
Process Scheduling                                             -Abhishek Nagar
Priority


                 Each process is assigned a priority. The ready list
                 contains an entry for each process ordered by its
                  priority. The process at the beginning of the list
                            (highest priority) is picked first.


                A variation of this scheme allows preemption of the
                  current process when a higher priority process
                                       arrives.




Process Scheduling                                                     -Abhishek Nagar
Priority - Example
                                 Process PriorityCPU Turnaround Waiting
                                                 Burst  Time     Time
      Process                       A       4     10      18       8
                                    B       3     1       8        7
                                    C       2     3       7        4
                                    D       1     4       4        0
                                                         9.25    4.75
                                          AVERAGE

        D
        C
        B
        A


                     5      10       15             20   25    Time

Process Scheduling                                                 -Abhishek Nagar
Thank You !
               Questions and Comments Welcome!

                         Abhishek Nagar
                       abhishek@nagarji.net

                     Process Scheduling Simulation
                         from gaia.ecs.csus.edu


Process Scheduling                                   -Abhishek Nagar

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Memory management
Memory managementMemory management
Memory management
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Pthread
PthreadPthread
Pthread
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Lecture 03 - Synchronous and Asynchronous Communication - Concurrency - Fault...
Lecture 03 - Synchronous and Asynchronous Communication - Concurrency - Fault...Lecture 03 - Synchronous and Asynchronous Communication - Concurrency - Fault...
Lecture 03 - Synchronous and Asynchronous Communication - Concurrency - Fault...
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed Computing
 
Context switching
Context switchingContext switching
Context switching
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling Algorithm
 
Process scheduling algorithms
Process scheduling algorithmsProcess scheduling algorithms
Process scheduling algorithms
 
process creation OS
process creation OSprocess creation OS
process creation OS
 
Multilevel queue scheduling
Multilevel queue schedulingMultilevel queue scheduling
Multilevel queue scheduling
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin scheduling
 

Destacado (14)

Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Os Question Bank
Os Question BankOs Question Bank
Os Question Bank
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Scheduling
 
Scheduling Algorithms
Scheduling AlgorithmsScheduling Algorithms
Scheduling Algorithms
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 

Similar a Process Scheduling

Aminullah Assagaf_P14-Ch.17_Scheduling-32.pptx
Aminullah Assagaf_P14-Ch.17_Scheduling-32.pptxAminullah Assagaf_P14-Ch.17_Scheduling-32.pptx
Aminullah Assagaf_P14-Ch.17_Scheduling-32.pptx
Aminullah Assagaf
 
Pert & cpm project management
Pert & cpm   project managementPert & cpm   project management
Pert & cpm project management
Rahul Dubey
 
Litttle knowledge of lean concept helps
Litttle knowledge of lean  concept helpsLitttle knowledge of lean  concept helps
Litttle knowledge of lean concept helps
SF Lau
 

Similar a Process Scheduling (20)

Aminullah Assagaf_P14-Ch.17_Scheduling-32.pptx
Aminullah Assagaf_P14-Ch.17_Scheduling-32.pptxAminullah Assagaf_P14-Ch.17_Scheduling-32.pptx
Aminullah Assagaf_P14-Ch.17_Scheduling-32.pptx
 
Process and CPU scheduler
Process and CPU schedulerProcess and CPU scheduler
Process and CPU scheduler
 
RoundRobin _ OS_LAB.pptx
RoundRobin _ OS_LAB.pptxRoundRobin _ OS_LAB.pptx
RoundRobin _ OS_LAB.pptx
 
Tn6 facility layout
Tn6 facility layoutTn6 facility layout
Tn6 facility layout
 
Tn6 facility+layout
Tn6 facility+layoutTn6 facility+layout
Tn6 facility+layout
 
Pert & cpm project management
Pert & cpm   project managementPert & cpm   project management
Pert & cpm project management
 
OS ASSIGNMENT.pptx
OS ASSIGNMENT.pptxOS ASSIGNMENT.pptx
OS ASSIGNMENT.pptx
 
Scheduling
SchedulingScheduling
Scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
Topic 5 Production Sequencing and Scheduling.ppt
Topic 5 Production Sequencing and Scheduling.pptTopic 5 Production Sequencing and Scheduling.ppt
Topic 5 Production Sequencing and Scheduling.ppt
 
Task allocation and scheduling inmultiprocessors
Task allocation and scheduling inmultiprocessorsTask allocation and scheduling inmultiprocessors
Task allocation and scheduling inmultiprocessors
 
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.
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdf
 
Litttle knowledge of lean concept helps
Litttle knowledge of lean  concept helpsLitttle knowledge of lean  concept helps
Litttle knowledge of lean concept helps
 
Scheduling
SchedulingScheduling
Scheduling
 
SCHEDULING
SCHEDULING  SCHEDULING
SCHEDULING
 
Homework solutionsch9
Homework solutionsch9Homework solutionsch9
Homework solutionsch9
 
crashing of project
crashing of project crashing of project
crashing of project
 
scheduling.ppt course not for industrial engineering students
scheduling.ppt course not for industrial engineering studentsscheduling.ppt course not for industrial engineering students
scheduling.ppt course not for industrial engineering students
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
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
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
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
 
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.
 
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...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
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
 
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
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
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
 

Process Scheduling

  • 1. Process Scheduling Abhishek Nagar Process Scheduling -Abhishek Nagar
  • 2. Agenda Introduction The Basics (Keywords) Scheduling Policies Scheduling Algorithms First Come First Served Shortest Job First Round Robin Priority Process Scheduling -Abhishek Nagar
  • 3. Introduction In multiprogramming systems, when there is more than one ready process, the operating system must decide which one to activate. The decision is made by the part of the operating system called the scheduler, using a scheduling algorithm. The scheduler is concerned with deciding policy, not providing a mechanism Process Scheduling -Abhishek Nagar
  • 4. The Basics (Keywords) Process CPU Burst (Usage Time) Turnaround Time Waiting Time Time Quantum (time slice) Process Scheduling -Abhishek Nagar
  • 5. Scheduling Policies Preemptive Non Preemptive Process Scheduling -Abhishek Nagar
  • 6. First Come First Served FCFS, also known as First-In-First-Out (FIFO), is the simplest scheduling policy. Arriving jobs are inserted into the tail (rear) of the ready queue and the process to be executed next is removed from the head (front) of the queue. Process Scheduling -Abhishek Nagar
  • 7. FCFS - Example Process CPU Turnaround Waiting Burst Time Time A 10 10 0 Process B 1 11 10 C 3 14 11 D 4 18 14 13.25 8.75 AVERAGE D C B A 5 10 15 20 25 Time Process Scheduling -Abhishek Nagar
  • 8. Shortest Job First SJF policy selects the job with the shortest (expected) processing time first. Shorter jobs are always executed before long jobs. long running jobs may starve, because the CPU has a steady supply of short jobs. Process Scheduling -Abhishek Nagar
  • 9. Shortest Job First - Example Process CPU Turnaround Waiting Burst Time Time Process A 10 18 8 B 1 1 0 C 3 4 1 D 4 8 4 7.75 3.25 AVERAGE D C B A 5 10 15 20 25 Time Process Scheduling -Abhishek Nagar
  • 10. Round Robin RR reduces the penalty that short jobs suffer with FCFS by preempting running jobs periodically. The CPU suspends the current job when the reserved quantum (time-slice) is exhausted. The job is then put at the end of the ready queue if not yet completed. Process Scheduling -Abhishek Nagar
  • 11. Round Robin - example Time Slice = 1 Process Process CPU Turnaround Waiting Burst Time Time A 10 18 8 B 1 2 1 C 3 9 6 D 4 12 6 D 10.25 5.75 AVERAGE C B A 5 10 15 20 25 Time Ready Queue Status : A B C D A C D A C D A D A Process Scheduling -Abhishek Nagar
  • 12. Priority Each process is assigned a priority. The ready list contains an entry for each process ordered by its priority. The process at the beginning of the list (highest priority) is picked first. A variation of this scheme allows preemption of the current process when a higher priority process arrives. Process Scheduling -Abhishek Nagar
  • 13. Priority - Example Process PriorityCPU Turnaround Waiting Burst Time Time Process A 4 10 18 8 B 3 1 8 7 C 2 3 7 4 D 1 4 4 0 9.25 4.75 AVERAGE D C B A 5 10 15 20 25 Time Process Scheduling -Abhishek Nagar
  • 14. Thank You ! Questions and Comments Welcome! Abhishek Nagar abhishek@nagarji.net Process Scheduling Simulation from gaia.ecs.csus.edu Process Scheduling -Abhishek Nagar