SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Scheduling Bits & Pieces




                           1
Windows Scheduling




                     2
Windows Scheduling
• Priority Boost when unblocking
  – Actual boost dependent on resource
     • Disk (1), serial (2), keyboard (6), soundcard (8)…..
     • Interactive, window event, semaphore (1 or 2)
  – Boost decrements if quantum expires
• Anti-starvation hack
  – If a ready process does not run for long time,
    it gets 2 quanta at priority 15

                                                         3
Priority Inheritance




                       4
Batch Algorithms
– Maximise throughput
   • Throughput is measured in jobs per hour (or similar)
– Minimise turn-around time
   • Turn-around time (Tr)
       – difference between time of completion and time of submission
       – Or waiting time (Tw) + execution time (Te)
– Maximise CPU utilisation
   • Keep the CPU busy
   • Not as good a metric as overall throughput




                                                                   5
First-Come First-Served (FCFS)
• Algorithm
  – Each job is placed in single queue, the first
    job in the queue is selected, and allowed to
    run as long as it wants.
  – If the job blocks, the next job in the queue is
    selected to run
  – When a blocked jobs becomes ready, it is
    placed at the end of the queue


                                                      6
Example
                       • 5 Jobs
J1
                           – Job 1 arrives slightly
                             before job 2, etc…
J2
                           – All are immediately
J3                           runnable
                           – Execution times
J4                           indicated by scale on
                             x-axis
J5

 0   2   4   6    8   10    12    14   16    18       20
                                                  7
FCFS Schedule

J1

J2

J3

J4

J5

 0   2   4    6   8   10   12   14   16   18       20
                                               8
FCFS
• Pros
  – Simple and easy to implement
• Cons
  – I/O-bound jobs wait for CPU-bound jobs
  ⇒Favours CPU-bound processes
     • Example:
         – Assume 1 CPU-bound process that computes for 1 second and
           blocks on a disk request. It arrives first.
         – Assume an I/O bound process that simply issues a 1000
           blocking disk requests (very little CPU time)
         – FCFS, the I/O bound process can only issue a disk request per
           second
              » the I/O bound process take 1000 seconds to finish
         – Another scheme, that preempts the CPU-bound process when
           I/O-bound process are ready, could allow I/O-bound process to
           finish in 1000* average disk access time.
                                                                     9
Shortest Job First
• If we know (or can estimate) the execution
  time a priori, we choose the shortest job
  first.
• Another non-preemptive policy




                                          10
Our Previous Example
                        • 5 Jobs
J1
                            – Job 1 arrives slightly
                              before job 2, etc…
J2
                            – All are immediately
J3                            runnable
                            – Execution times
J4                            indicated by scale on
                              x-axis
J5

 0   2     4   6   8   10    12    14   16    18        20
                                                   11
Shortest Job First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              12
Shortest Job First
• Con
  – May starve long jobs
  – Needs to predict job length
• Pro
  – Minimises average turnaround time (if, and only if, all
    jobs are available at the beginning)
  – Example: Assume for processes with execution times
    of a, b, c, d.
        • a finishes at time a, b finishes at a + b, c at a + b + c, and so
          on
        • Average turn-around time is (4a + 3b + 2c + d)/4
        • Since a contributes most to average turn-around time, it
          should be the shortest job.
                                                                       13
Shortest Remaining Time First
• A preemptive version of shortest job first
• When ever a new jobs arrive, choose the
  one with the shortest remaining time first
  – New short jobs get good service




                                           14
Example
                       • 5 Jobs
J1
                           – Release and execution
                             times as shown
J2

J3

J4

J5

 0   2   4   6    8   10    12   14   16   18        20
                                                15
Shortest Remaining Time First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              16
Shortest Remaining Time First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              17
Shortest Remaining Time First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              18
Shortest Remaining Time First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              19
Shortest Remaining Time First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              20
Shortest Remaining Time First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              21
Shortest Remaining Time First

J1

J2

J3

J4

J5

 0   2   4   6   8   10   12   14   16   18        20
                                              22
Scheduling in Batch Systems




     Three level scheduling

                              23
Three Level Scheduling
• Admission Scheduler
  – Also called long-term scheduler
  – Determines when jobs are admitted into the
    system for processing
  – Controls degree of multiprogramming
  – More processes ⇒ less CPU available per
    process



                                                 24
Three Level Scheduling
• CPU scheduler
  – Also called short-term scheduler
  – Invoked when ever a process blocks or is
    released, clock interrupts (if preemptive
    scheduling), I/O interrupts.
  – Usually, this scheduler is what we are
    referring to if we talk about a scheduler.



                                                 25
Three Level Scheduling
• Memory Scheduler
  – Also called medium-term scheduler
  – Adjusts the degree of multiprogramming via
    suspending processes and swapping them
    out




                                                 26
Some Issues with Priorities
• Require adaption over time to avoid starvation
  (not considering hard real-time which relies on
  strict priorities).
• Adaption is:
  – usually ad-hoc,
     • hence behaviour not thoroughly understood, and
       unpredictable
  – Gradual, hence unresponsive
• Difficult to guarantee a desired share of the CPU
• No way for applications to trade CPU time

                                                        27
Lottery Scheduling
• Each process is issued with “lottery
  tickets” which represent the right to
  use/consume a resource
  – Example: CPU time
• Access to a resource is via “drawing” a
  lottery winner.
  – The more tickets a process possesses, the
    higher chance the process has of winning.

                                                28
Lottery Scheduling
• Advantages
  – Simple to implement
  – Highly responsive
    • can reallocate tickets held for immediate effect
  – Tickets can be traded to implement individual
    scheduling policy between co-operating
    threads
  – Starvation free
    • A process holding a ticket will eventually be
      scheduled.

                                                         29
Example Lottery Scheduling
• Four process running concurrently
  – Process A: 15% CPU
  – Process B: 25% CPU
  – Process C: 5% CPU
  – Process D: 55% CPU


• How many tickets should be issued to
  each?
                                         30
Lottery Scheduling Performance
Observed performance of
  two processes with
  varying ratios of tickets




                              31
32
Fair-Share Scheduling
• So far we have treated processes as individuals
• Assume two users
   – One user has 1 process
   – Second user has 9 processes
• The second user gets 90% of the CPU
• Some schedulers consider the owner of the process in
  determining which process to schedule
   – E.g., for the above example we could schedule the first user’s
     process 9 times more often than the second user’s processes
• Many possibilities exist to determine a fair schedule
   – E.g. Appropriate allocation of tickets in lottery scheduler

                                                                   33

Contenu connexe

Tendances

Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Schedulingsathish sak
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...David Evans
 
cpu scheduling by shivam singh
cpu scheduling by shivam singhcpu scheduling by shivam singh
cpu scheduling by shivam singhshivam71291
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithmsPaurav Shah
 
Real time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CSReal time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CSThanveen
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time SystemsDeepak John
 
Real time-system
Real time-systemReal time-system
Real time-systemysush
 
Scheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.SivakumarScheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.SivakumarSivakumar R D .
 
Hard versus Soft real time system
Hard versus Soft real time systemHard versus Soft real time system
Hard versus Soft real time systemKamal Acharya
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-schedulingHesham Elmasry
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinShubham Singh
 

Tendances (20)

Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
cpu scheduling by shivam singh
cpu scheduling by shivam singhcpu scheduling by shivam singh
cpu scheduling by shivam singh
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
CPU Sheduling
CPU Sheduling CPU Sheduling
CPU Sheduling
 
Real time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CSReal time Scheduling in Operating System for Msc CS
Real time Scheduling in Operating System for Msc CS
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Algorithm o.s.
Algorithm o.s.Algorithm o.s.
Algorithm o.s.
 
Real time-system
Real time-systemReal time-system
Real time-system
 
Scheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.SivakumarScheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.Sivakumar
 
PPT CPU
PPT CPUPPT CPU
PPT CPU
 
Hard versus Soft real time system
Hard versus Soft real time systemHard versus Soft real time system
Hard versus Soft real time system
 
Ch5 answers
Ch5 answersCh5 answers
Ch5 answers
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
Reviewer cpu scheduling
Reviewer cpu schedulingReviewer cpu scheduling
Reviewer cpu scheduling
 
Chapter4
Chapter4Chapter4
Chapter4
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-scheduling
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvin
 

En vedette

Cao ốc âu cơ tower
Cao ốc âu cơ towerCao ốc âu cơ tower
Cao ốc âu cơ towertranduyen76
 
dMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-EdMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-Edmtgms
 
Breast Cancer Management
Breast Cancer ManagementBreast Cancer Management
Breast Cancer ManagementAbdul Basit
 
Tele4653 l8
Tele4653 l8Tele4653 l8
Tele4653 l8Vin Voro
 
RMCAD and Markit on Demand collaboration
RMCAD and Markit on Demand collaborationRMCAD and Markit on Demand collaboration
RMCAD and Markit on Demand collaborationCumulus Digital Culture
 
Uth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - UpdatedUth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - UpdatedUth Mag
 
Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998Josep Miquel
 
Kamaroninfo núm. 8 novembre 1996
Kamaroninfo núm. 8 novembre 1996Kamaroninfo núm. 8 novembre 1996
Kamaroninfo núm. 8 novembre 1996Josep Miquel
 
TEC CONTAINER - DELIVERED 2013 - 2016
TEC CONTAINER - DELIVERED 2013 - 2016TEC CONTAINER - DELIVERED 2013 - 2016
TEC CONTAINER - DELIVERED 2013 - 2016teccontainer
 
dMT SPC Presentation Cranes & other-engl.
dMT SPC Presentation Cranes & other-engl.dMT SPC Presentation Cranes & other-engl.
dMT SPC Presentation Cranes & other-engl.dmtgms
 
Leermiddelen
LeermiddelenLeermiddelen
Leermiddelenwimdboer
 
Leermiddelen
LeermiddelenLeermiddelen
Leermiddelenwimdboer
 
General Applications Info.-E
General Applications Info.-EGeneral Applications Info.-E
General Applications Info.-Edmtgms
 
Oral presentation
Oral presentationOral presentation
Oral presentationVin Voro
 

En vedette (20)

Cao ốc âu cơ tower
Cao ốc âu cơ towerCao ốc âu cơ tower
Cao ốc âu cơ tower
 
dMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-EdMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-E
 
Breast Cancer Management
Breast Cancer ManagementBreast Cancer Management
Breast Cancer Management
 
Tvi presentation
Tvi presentationTvi presentation
Tvi presentation
 
Tele4653 l8
Tele4653 l8Tele4653 l8
Tele4653 l8
 
RMCAD and Markit on Demand collaboration
RMCAD and Markit on Demand collaborationRMCAD and Markit on Demand collaboration
RMCAD and Markit on Demand collaboration
 
Tekno dakwah design
Tekno dakwah   designTekno dakwah   design
Tekno dakwah design
 
B2B Part III
B2B Part IIIB2B Part III
B2B Part III
 
хүн орчин
хүн орчинхүн орчин
хүн орчин
 
Uth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - UpdatedUth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - Updated
 
Extlect04
Extlect04Extlect04
Extlect04
 
Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998
 
Kamaroninfo núm. 8 novembre 1996
Kamaroninfo núm. 8 novembre 1996Kamaroninfo núm. 8 novembre 1996
Kamaroninfo núm. 8 novembre 1996
 
TEC CONTAINER - DELIVERED 2013 - 2016
TEC CONTAINER - DELIVERED 2013 - 2016TEC CONTAINER - DELIVERED 2013 - 2016
TEC CONTAINER - DELIVERED 2013 - 2016
 
dMT SPC Presentation Cranes & other-engl.
dMT SPC Presentation Cranes & other-engl.dMT SPC Presentation Cranes & other-engl.
dMT SPC Presentation Cranes & other-engl.
 
Leermiddelen
LeermiddelenLeermiddelen
Leermiddelen
 
Leermiddelen
LeermiddelenLeermiddelen
Leermiddelen
 
Wynn presentation 01 06-11 1540 hrs
Wynn presentation 01 06-11 1540 hrsWynn presentation 01 06-11 1540 hrs
Wynn presentation 01 06-11 1540 hrs
 
General Applications Info.-E
General Applications Info.-EGeneral Applications Info.-E
General Applications Info.-E
 
Oral presentation
Oral presentationOral presentation
Oral presentation
 

Similaire à Extlect02

Commonly used Approaches to Real Time Scheduling
Commonly used Approaches to Real Time SchedulingCommonly used Approaches to Real Time Scheduling
Commonly used Approaches to Real Time SchedulingRaaz Karkee
 
What to do when detect deadlock
What to do when detect deadlockWhat to do when detect deadlock
What to do when detect deadlockSyed Zaid Irshad
 
shortest job first
shortest job firstshortest job first
shortest job firsti i
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdfKp Sharma
 
3 process scheduling
3 process scheduling3 process scheduling
3 process schedulingahad alam
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-schedulingNazir Ahmed
 
fggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggffffffffffffffffffffggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggfffffffffffffffffffadugnanegero
 
Process Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating SystemsProcess Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating SystemsKathirvelRajan2
 
3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------DivyaBorade3
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OSharini0810
 
Cpu Schedule Algorithm
Cpu Schedule AlgorithmCpu Schedule Algorithm
Cpu Schedule AlgorithmArchit Jain
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithmssathish sak
 
dataprocess using different technology.ppt
dataprocess using different technology.pptdataprocess using different technology.ppt
dataprocess using different technology.pptssuserf6eb9b
 

Similaire à Extlect02 (20)

Lect07
Lect07Lect07
Lect07
 
Commonly used Approaches to Real Time Scheduling
Commonly used Approaches to Real Time SchedulingCommonly used Approaches to Real Time Scheduling
Commonly used Approaches to Real Time Scheduling
 
What to do when detect deadlock
What to do when detect deadlockWhat to do when detect deadlock
What to do when detect deadlock
 
shortest job first
shortest job firstshortest job first
shortest job first
 
20
20 20
20
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
Scheduling
SchedulingScheduling
Scheduling
 
3 process scheduling
3 process scheduling3 process scheduling
3 process scheduling
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
fggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggffffffffffffffffffffggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggfffffffffffffffffff
 
Process Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating SystemsProcess Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating Systems
 
3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
 
Planificacion
PlanificacionPlanificacion
Planificacion
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
Cpu Schedule Algorithm
Cpu Schedule AlgorithmCpu Schedule Algorithm
Cpu Schedule Algorithm
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
dataprocess using different technology.ppt
dataprocess using different technology.pptdataprocess using different technology.ppt
dataprocess using different technology.ppt
 

Plus de Vin Voro

Tele3113 tut6
Tele3113 tut6Tele3113 tut6
Tele3113 tut6Vin Voro
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5Vin Voro
 
Tele3113 tut4
Tele3113 tut4Tele3113 tut4
Tele3113 tut4Vin Voro
 
Tele3113 tut1
Tele3113 tut1Tele3113 tut1
Tele3113 tut1Vin Voro
 
Tele3113 tut3
Tele3113 tut3Tele3113 tut3
Tele3113 tut3Vin Voro
 
Tele3113 tut2
Tele3113 tut2Tele3113 tut2
Tele3113 tut2Vin Voro
 
Tele3113 wk11tue
Tele3113 wk11tueTele3113 wk11tue
Tele3113 wk11tueVin Voro
 
Tele3113 wk10wed
Tele3113 wk10wedTele3113 wk10wed
Tele3113 wk10wedVin Voro
 
Tele3113 wk10tue
Tele3113 wk10tueTele3113 wk10tue
Tele3113 wk10tueVin Voro
 
Tele3113 wk11wed
Tele3113 wk11wedTele3113 wk11wed
Tele3113 wk11wedVin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wedVin Voro
 
Tele3113 wk9tue
Tele3113 wk9tueTele3113 wk9tue
Tele3113 wk9tueVin Voro
 
Tele3113 wk8wed
Tele3113 wk8wedTele3113 wk8wed
Tele3113 wk8wedVin Voro
 
Tele3113 wk9wed
Tele3113 wk9wedTele3113 wk9wed
Tele3113 wk9wedVin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wedVin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wedVin Voro
 
Tele3113 wk7tue
Tele3113 wk7tueTele3113 wk7tue
Tele3113 wk7tueVin Voro
 
Tele3113 wk6wed
Tele3113 wk6wedTele3113 wk6wed
Tele3113 wk6wedVin Voro
 
Tele3113 wk6tue
Tele3113 wk6tueTele3113 wk6tue
Tele3113 wk6tueVin Voro
 
Tele3113 wk5tue
Tele3113 wk5tueTele3113 wk5tue
Tele3113 wk5tueVin Voro
 

Plus de Vin Voro (20)

Tele3113 tut6
Tele3113 tut6Tele3113 tut6
Tele3113 tut6
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5
 
Tele3113 tut4
Tele3113 tut4Tele3113 tut4
Tele3113 tut4
 
Tele3113 tut1
Tele3113 tut1Tele3113 tut1
Tele3113 tut1
 
Tele3113 tut3
Tele3113 tut3Tele3113 tut3
Tele3113 tut3
 
Tele3113 tut2
Tele3113 tut2Tele3113 tut2
Tele3113 tut2
 
Tele3113 wk11tue
Tele3113 wk11tueTele3113 wk11tue
Tele3113 wk11tue
 
Tele3113 wk10wed
Tele3113 wk10wedTele3113 wk10wed
Tele3113 wk10wed
 
Tele3113 wk10tue
Tele3113 wk10tueTele3113 wk10tue
Tele3113 wk10tue
 
Tele3113 wk11wed
Tele3113 wk11wedTele3113 wk11wed
Tele3113 wk11wed
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
 
Tele3113 wk9tue
Tele3113 wk9tueTele3113 wk9tue
Tele3113 wk9tue
 
Tele3113 wk8wed
Tele3113 wk8wedTele3113 wk8wed
Tele3113 wk8wed
 
Tele3113 wk9wed
Tele3113 wk9wedTele3113 wk9wed
Tele3113 wk9wed
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
 
Tele3113 wk7tue
Tele3113 wk7tueTele3113 wk7tue
Tele3113 wk7tue
 
Tele3113 wk6wed
Tele3113 wk6wedTele3113 wk6wed
Tele3113 wk6wed
 
Tele3113 wk6tue
Tele3113 wk6tueTele3113 wk6tue
Tele3113 wk6tue
 
Tele3113 wk5tue
Tele3113 wk5tueTele3113 wk5tue
Tele3113 wk5tue
 

Dernier

DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 

Dernier (20)

DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 

Extlect02

  • 1. Scheduling Bits & Pieces 1
  • 3. Windows Scheduling • Priority Boost when unblocking – Actual boost dependent on resource • Disk (1), serial (2), keyboard (6), soundcard (8)….. • Interactive, window event, semaphore (1 or 2) – Boost decrements if quantum expires • Anti-starvation hack – If a ready process does not run for long time, it gets 2 quanta at priority 15 3
  • 5. Batch Algorithms – Maximise throughput • Throughput is measured in jobs per hour (or similar) – Minimise turn-around time • Turn-around time (Tr) – difference between time of completion and time of submission – Or waiting time (Tw) + execution time (Te) – Maximise CPU utilisation • Keep the CPU busy • Not as good a metric as overall throughput 5
  • 6. First-Come First-Served (FCFS) • Algorithm – Each job is placed in single queue, the first job in the queue is selected, and allowed to run as long as it wants. – If the job blocks, the next job in the queue is selected to run – When a blocked jobs becomes ready, it is placed at the end of the queue 6
  • 7. Example • 5 Jobs J1 – Job 1 arrives slightly before job 2, etc… J2 – All are immediately J3 runnable – Execution times J4 indicated by scale on x-axis J5 0 2 4 6 8 10 12 14 16 18 20 7
  • 8. FCFS Schedule J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 8
  • 9. FCFS • Pros – Simple and easy to implement • Cons – I/O-bound jobs wait for CPU-bound jobs ⇒Favours CPU-bound processes • Example: – Assume 1 CPU-bound process that computes for 1 second and blocks on a disk request. It arrives first. – Assume an I/O bound process that simply issues a 1000 blocking disk requests (very little CPU time) – FCFS, the I/O bound process can only issue a disk request per second » the I/O bound process take 1000 seconds to finish – Another scheme, that preempts the CPU-bound process when I/O-bound process are ready, could allow I/O-bound process to finish in 1000* average disk access time. 9
  • 10. Shortest Job First • If we know (or can estimate) the execution time a priori, we choose the shortest job first. • Another non-preemptive policy 10
  • 11. Our Previous Example • 5 Jobs J1 – Job 1 arrives slightly before job 2, etc… J2 – All are immediately J3 runnable – Execution times J4 indicated by scale on x-axis J5 0 2 4 6 8 10 12 14 16 18 20 11
  • 12. Shortest Job First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 12
  • 13. Shortest Job First • Con – May starve long jobs – Needs to predict job length • Pro – Minimises average turnaround time (if, and only if, all jobs are available at the beginning) – Example: Assume for processes with execution times of a, b, c, d. • a finishes at time a, b finishes at a + b, c at a + b + c, and so on • Average turn-around time is (4a + 3b + 2c + d)/4 • Since a contributes most to average turn-around time, it should be the shortest job. 13
  • 14. Shortest Remaining Time First • A preemptive version of shortest job first • When ever a new jobs arrive, choose the one with the shortest remaining time first – New short jobs get good service 14
  • 15. Example • 5 Jobs J1 – Release and execution times as shown J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 15
  • 16. Shortest Remaining Time First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 16
  • 17. Shortest Remaining Time First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 17
  • 18. Shortest Remaining Time First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 18
  • 19. Shortest Remaining Time First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 19
  • 20. Shortest Remaining Time First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 20
  • 21. Shortest Remaining Time First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 21
  • 22. Shortest Remaining Time First J1 J2 J3 J4 J5 0 2 4 6 8 10 12 14 16 18 20 22
  • 23. Scheduling in Batch Systems Three level scheduling 23
  • 24. Three Level Scheduling • Admission Scheduler – Also called long-term scheduler – Determines when jobs are admitted into the system for processing – Controls degree of multiprogramming – More processes ⇒ less CPU available per process 24
  • 25. Three Level Scheduling • CPU scheduler – Also called short-term scheduler – Invoked when ever a process blocks or is released, clock interrupts (if preemptive scheduling), I/O interrupts. – Usually, this scheduler is what we are referring to if we talk about a scheduler. 25
  • 26. Three Level Scheduling • Memory Scheduler – Also called medium-term scheduler – Adjusts the degree of multiprogramming via suspending processes and swapping them out 26
  • 27. Some Issues with Priorities • Require adaption over time to avoid starvation (not considering hard real-time which relies on strict priorities). • Adaption is: – usually ad-hoc, • hence behaviour not thoroughly understood, and unpredictable – Gradual, hence unresponsive • Difficult to guarantee a desired share of the CPU • No way for applications to trade CPU time 27
  • 28. Lottery Scheduling • Each process is issued with “lottery tickets” which represent the right to use/consume a resource – Example: CPU time • Access to a resource is via “drawing” a lottery winner. – The more tickets a process possesses, the higher chance the process has of winning. 28
  • 29. Lottery Scheduling • Advantages – Simple to implement – Highly responsive • can reallocate tickets held for immediate effect – Tickets can be traded to implement individual scheduling policy between co-operating threads – Starvation free • A process holding a ticket will eventually be scheduled. 29
  • 30. Example Lottery Scheduling • Four process running concurrently – Process A: 15% CPU – Process B: 25% CPU – Process C: 5% CPU – Process D: 55% CPU • How many tickets should be issued to each? 30
  • 31. Lottery Scheduling Performance Observed performance of two processes with varying ratios of tickets 31
  • 32. 32
  • 33. Fair-Share Scheduling • So far we have treated processes as individuals • Assume two users – One user has 1 process – Second user has 9 processes • The second user gets 90% of the CPU • Some schedulers consider the owner of the process in determining which process to schedule – E.g., for the above example we could schedule the first user’s process 9 times more often than the second user’s processes • Many possibilities exist to determine a fair schedule – E.g. Appropriate allocation of tickets in lottery scheduler 33