CPU%20Scheduling - PowerPoint PPT Presentation

About This Presentation
Title:

CPU%20Scheduling

Description:

... switching the CPU among processes, the O.S. can make the system more productive ... Ready Queue is set of PCBs in: FIFO queue. priority queue (actually a ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 11
Provided by: sharonp5
Learn more at: http://sce.uhcl.edu
Category:
Tags: 20scheduling | cpu | make

less

Transcript and Presenter's Notes

Title: CPU%20Scheduling


1
CPU Scheduling
  • CSCI 4534

2
Introduction
  • By switching the CPU among processes, the O.S.
    can make the system more productive
  • Some process is running at all times
  • Several processes are kept in memory
  • A process is executed until it must wait
  • typically for I/O
  • When this process waits, another runs
  • running means the CPU is executing it

3
CPU-I/O Burst Cycle
  • Observed Property of Processes
  • Processes alternate between a cycle of CPU
    execution and I/O wait
  • CPU burst
  • I/O burst (read from file/write to file)
  • CPU burst
  • CPU burst (to terminate)

4
CPU-I/O Burst Cycle
  • Durations of CPU bursts vary, but curve is
    similar to Figure 5.2 histogram, typically
  • large number of short CPU bursts
  • small number of long CPU bursts
  • I/O bound programs have many short CPU bursts
  • CPU bound programs have a few long CPU bursts

5
CPU Scheduler
  • When CPU is idle, the O.S. selects a process in
    the ready queue
  • Done by short-term scheduler / CPU scheduler
  • Ready Queue is set of PCBs in
  • FIFO queue
  • priority queue (actually a Ready State, not
    queue)
  • tree
  • unordered linked list

6
CPU Scheduling Decisions
  • CPU scheduling decisions are made when
  • A process switches from running to waiting
  • A process switches from running to ready
  • A process switches from waiting to ready
  • A process terminates
  • What is preemptive?
  • What are problems?
  • What is nonpreemptive?

7
Dispatcher
  • The dispatcher gives control of CPU to the
    process selected by short-term scheduler
  • It does context switching
  • It switches to user mode
  • It jumps to next executable statement in the user
    program
  • The time taken to stop one process and start
    another is dispatch latency
  • interval between stimulation and response

8
Scheduling Criteria
  • CPU utilization
  • Throughput - processes completed per time unit
  • Turnaround time - time from submission to
    completion
  • Waiting time - in the ready queue
  • Response time - time from submission to first
    response

9
Scheduling Criteria
  • Goals
  • Maximize CPU Utilization and Throughput
  • Minimize Turnaround, Waiting and Response Times
  • May also want to minimize variance for response
    time for more predictability

10
Scheduling Algorithms
  • FCFS
  • SJF
  • Priority Scheduling
  • Round-Robin
  • Multilevel Queue
  • Multilevel Feedback Queue
Write a Comment
User Comments (0)
About PowerShow.com