SlideShare a Scribd company logo
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 Scheduling
sathish 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
CPU SchedulingCPU Scheduling
CPU Scheduling
M. Abdullah Wasif
 
cpu scheduling by shivam singh
cpu scheduling by shivam singhcpu scheduling by shivam singh
cpu scheduling by shivam singh
shivam71291
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
Paurav Shah
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
marangburu42
 
CPU Sheduling
CPU Sheduling CPU Sheduling
CPU Sheduling
Prasad Sawant
 
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
Thanveen
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
Deepak John
 
Algorithm o.s.
Algorithm o.s.Algorithm o.s.
Algorithm o.s.
Mohd Tousif
 
Real time-system
Real time-systemReal time-system
Real time-system
ysush
 
Scheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.SivakumarScheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.Sivakumar
Sivakumar R D .
 
PPT CPU
PPT CPUPPT CPU
PPT CPU
Arun kumar
 
Hard versus Soft real time system
Hard versus Soft real time systemHard versus Soft real time system
Hard versus Soft real time system
Kamal Acharya
 
Ch5 answers
Ch5 answersCh5 answers
Ch5 answers
Hailemariam brhane
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
nidsrajdev
 
Reviewer cpu scheduling
Reviewer cpu schedulingReviewer cpu scheduling
Reviewer cpu scheduling
Von Adam Martinez
 
Chapter4
Chapter4Chapter4
Chapter4
poi01poi10
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-scheduling
Hesham Elmasry
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvin
Shubham 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ơ tower
tranduyen76
 
dMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-EdMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-E
dmtgms
 
Breast Cancer Management
Breast Cancer ManagementBreast Cancer Management
Breast Cancer Management
Abdul Basit
 
Tvi presentation
Tvi presentationTvi presentation
Tvi presentation
Muhammad Fauzi
 
Tele4653 l8
Tele4653 l8Tele4653 l8
Tele4653 l8
Vin Voro
 
RMCAD and Markit on Demand collaboration
RMCAD and Markit on Demand collaborationRMCAD and Markit on Demand collaboration
RMCAD and Markit on Demand collaboration
Cumulus Digital Culture
 
B2B Part III
B2B Part IIIB2B Part III
B2B Part III
Ashley Spilak
 
Uth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - UpdatedUth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - Updated
Uth Mag
 
Extlect04
Extlect04Extlect04
Extlect04
Vin Voro
 
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 - 2016
teccontainer
 
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
Leermiddelen
wimdboer
 
Leermiddelen
LeermiddelenLeermiddelen
Leermiddelen
wimdboer
 
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
Ecole hôtelière de Lausanne
 
General Applications Info.-E
General Applications Info.-EGeneral Applications Info.-E
General Applications Info.-E
dmtgms
 
Oral presentation
Oral presentationOral presentation
Oral presentation
Vin 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

Lect07
Lect07Lect07
Lect07
Vin Voro
 
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
Raaz Karkee
 
What to do when detect deadlock
What to do when detect deadlockWhat to do when detect deadlock
What to do when detect deadlock
Syed Zaid Irshad
 
shortest job first
shortest job firstshortest job first
shortest job first
i i
 
20
20 20
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
Kp Sharma
 
Scheduling
SchedulingScheduling
Scheduling
ROSHNI PRADHAN
 
3 process scheduling
3 process scheduling3 process scheduling
3 process scheduling
ahad alam
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
Nazir Ahmed
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
Dr. Loganathan R
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
ShrutiArora343479
 
fggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggffffffffffffffffffffggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggfffffffffffffffffff
adugnanegero
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
AbdulRahman491811
 
Process Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating SystemsProcess Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating Systems
KathirvelRajan2
 
3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------
DivyaBorade3
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
Dr. Mazin Mohamed alkathiri
 
Planificacion
PlanificacionPlanificacion
Planificacion
David Lilue
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
harini0810
 
Cpu Schedule Algorithm
Cpu Schedule AlgorithmCpu Schedule Algorithm
Cpu Schedule Algorithm
Archit Jain
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
sathish sak
 

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
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
 
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----------------
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
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
 

More from Vin Voro

Tele3113 tut6
Tele3113 tut6Tele3113 tut6
Tele3113 tut6
Vin Voro
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5
Vin Voro
 
Tele3113 tut4
Tele3113 tut4Tele3113 tut4
Tele3113 tut4
Vin Voro
 
Tele3113 tut1
Tele3113 tut1Tele3113 tut1
Tele3113 tut1
Vin Voro
 
Tele3113 tut3
Tele3113 tut3Tele3113 tut3
Tele3113 tut3
Vin Voro
 
Tele3113 tut2
Tele3113 tut2Tele3113 tut2
Tele3113 tut2
Vin Voro
 
Tele3113 wk11tue
Tele3113 wk11tueTele3113 wk11tue
Tele3113 wk11tue
Vin Voro
 
Tele3113 wk10wed
Tele3113 wk10wedTele3113 wk10wed
Tele3113 wk10wed
Vin Voro
 
Tele3113 wk10tue
Tele3113 wk10tueTele3113 wk10tue
Tele3113 wk10tue
Vin Voro
 
Tele3113 wk11wed
Tele3113 wk11wedTele3113 wk11wed
Tele3113 wk11wed
Vin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
Vin Voro
 
Tele3113 wk9tue
Tele3113 wk9tueTele3113 wk9tue
Tele3113 wk9tue
Vin Voro
 
Tele3113 wk8wed
Tele3113 wk8wedTele3113 wk8wed
Tele3113 wk8wed
Vin Voro
 
Tele3113 wk9wed
Tele3113 wk9wedTele3113 wk9wed
Tele3113 wk9wed
Vin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
Vin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
Vin Voro
 
Tele3113 wk7tue
Tele3113 wk7tueTele3113 wk7tue
Tele3113 wk7tue
Vin Voro
 
Tele3113 wk6wed
Tele3113 wk6wedTele3113 wk6wed
Tele3113 wk6wed
Vin Voro
 
Tele3113 wk6tue
Tele3113 wk6tueTele3113 wk6tue
Tele3113 wk6tue
Vin Voro
 
Tele3113 wk5tue
Tele3113 wk5tueTele3113 wk5tue
Tele3113 wk5tue
Vin 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

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 

Recently uploaded (20)

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 

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