SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
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
AnaAcapella
 

Kürzlich hochgeladen (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
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...
 
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.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
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
 
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
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
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
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

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