SlideShare a Scribd company logo
1 of 33
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
 
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
 
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
 

More from 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
 

More from 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
 

Recently uploaded

Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
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
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
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
 

Recently uploaded (20)

Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
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
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.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
 

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