Operating Systems - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Operating Systems

Description:

Round-Robin (RR) Scheduling. Priority Scheduling. Multilevel Queue (MQ) Scheduling ... Same example, but new. processes may preempt. a running process ... – PowerPoint PPT presentation

Number of Views:103
Avg rating:3.0/5.0
Slides: 15
Provided by: DavidGol3
Category:

less

Transcript and Presenter's Notes

Title: Operating Systems


1
OperatingSystems
CIS 432March 13, 2008
  • David Goldschmidt, Ph.D.
  • Computer Science
  • The College of Saint Rose

2
Dispatcher
  • The dispatcher gives control of the CPU to the
    process selected by the CPU scheduler
  • Performs context switch
  • Switches to user mode
  • Jumps to the proper location inthe user program
    to resumeprogram execution
  • The dispatch latency time is the time it takes
    for the dispatcher to stop one process and start
    another

3
CPU Scheduling Algorithms
  • Algorithms include
  • First-Come, First-Served (FCFS) Scheduling
  • Shortest-Job-First (SJF) Scheduling
  • Round-Robin (RR) Scheduling
  • Priority Scheduling
  • Multilevel Queue (MQ) Scheduling

4
Scheduling Criteria
maximize
  • Scheduling criteria include
  • CPU utilization keep the CPU as busy as
    possible
  • Throughput number of processes that complete
    their execution per time unit
  • Turnaround time elapsed time to fully execute a
    particular process
  • Waiting time elapsed time a process has been
    waiting in the ready queue
  • Response time elapsed time from when a request
    was submitted until the first response is
    produced (not necessarily output)

minimize
5
First-Come, First-Served (FCFS)
  • FCFS dispatches processes in the orderthey enter
    the ready queue
  • For example
  • Waiting times P1 0 P2 24ms P3 27ms
  • Average waiting time (0 24 27)/3 17ms

non-preemptive
6
Shortest-Job-First (SJF)
  • SJF dispatches processes by selecting the process
    with the lowest expected CPU burst time
  • For example
  • Waiting times P2 0 P3 3ms P1 6ms
  • Average waiting time (0 3 6)/3 3ms

non-preemptive
7
Shortest-Job-First (SJF)
  • Non-preemptive SFJ
  • Another example
  • Waiting times P1 0 P3 3ms P2 6ms P4
    7ms
  • Average waiting time (0 3 6 7)/4 4ms

8
Shortest-Job-First (SJF)
  • Preemptive SFJ
  • Same example, but newprocesses may preempta
    running process
  • Waiting times P1 9 P2 1ms P3 0ms P4
    2ms
  • Average waiting time (9 1 0 2)/4 3ms

9
Shortest-Job-First (SJF)
  • The key problem with SJF is the inability
    topredict required CPU burst times
  • Prediction algorithm based on previous CPU burst
    times
  • Algorithm uses exponential averaging
  • tn actual length of the nth CPU burst
  • tn1 predicted value for the next CPU burst
  • tn1 a tn (1 a) tn , where 0 lt a lt 1

a determines the degree to whichthe past impacts
the future
10
Shortest-Job-First (SJF)
11
Priority Scheduling
  • Associate a priority number with each process
  • The dispatcher selects the processwith the
    highest priority
  • For multiple ready processes withidentical
    priority numbers, use FCFS
  • Key problem is starvation
  • Overcome starvation by aging, increasingthe
    priority of a process as it ages

typically, a lower priority numberindicates a
higher priority
12
Multilevel Queue (MQ)
  • Assign processes to multiple queues, each
    potentially with its own scheduling algorithm

13
Multilevel Feedback Queue
  • Dynamically assign processes to multiple queues
    based on actual CPU burst times

i.e. based on feedback
14
Reading Assignments
  • Read for next week
  • Chapters 5 and 6 of the Dinosaur Book
Write a Comment
User Comments (0)
About PowerShow.com