CPU Scheduling - PowerPoint PPT Presentation

About This Presentation
Title:

CPU Scheduling

Description:

P4 3 Gantt chart. AWT is 7ms. AWT for FCFS would be: Used in long term scheduling. P2 ... AWT = 5.66, Gantt chart: Context switching. Multilevel Queue Scheduling ... – PowerPoint PPT presentation

Number of Views:12
Avg rating:3.0/5.0
Slides: 11
Provided by: angel101
Category:
Tags: cpu | chart | gantt | scheduling

less

Transcript and Presenter's Notes

Title: CPU Scheduling


1
CPU Scheduling
  • Scheduling Algorithms

2
Introduction
  • Scheduling is the basic OS function
  • Nearly all computer resources are scheduled
    before use
  • CPU scheduling is the basic of multi -programmed
    OS
  • The main objective of multi-programming is to
    have some processes running at all times, to
    maximize CPU utilization

3
Scheduling Criteria
  • CPU utilization
  • Range from 0 to 100
  • Throughput
  • Number of processes completed per unit time
  • Turnaround time
  • Interval from submission to completion
  • Waiting time
  • Time spent waiting in the ready queue
  • Response time
  • Time to start responding

4
FCFS or First-Come First-Served
  • FIFO queue
  • Simple to implement
  • The average waiting time is long
  • Process Burst Time ms
  • P1 24
  • P2 3
  • P3 3
  • Gantt chart
  • AWT is 17ms
  • Compare to P2,P3,P1

P1 P2 P3
5
SJF or Shortest-Job-First
  • Shortest next CPU burst
  • Process Burst Time ms
  • P1 6
  • P2 8
  • P3 7
  • P4 3 Gantt chart
  • AWT is 7ms
  • AWT for FCFS would be
  • Used in long term scheduling

P4 P1 P3 P2
6
Shortest Remaining Time First
  • SJF may be preemptive or non-preemptive
  • Process Arrival Time Burst Time ms
  • P1 0 8
  • P2 1 4
  • P3 2 9
  • P4 3 5
  • AWT
  • ((10-1)(1-1)(17-2)(5-3))/46.5ms

P1 P2 P4 P1 P3
7
Priority Scheduling
  • FCFS, SJF are priority algorithms,
  • More general priority can be defined as a number
    p in the range 0-7, 0-4095
  • Process Burst Time Priority (0 high)
  • P1 10 3
  • P2 1 1
  • P3 2 3
  • P4 1 4
  • P5 5 2
  • Gannt chart, AWT
  • Aging is solution to indefinite blocking or
    starvation

8
RR or Round-Robin Scheduling
  • Like FCFS with preemption
  • Time quantum is defined (10-100ms)
  • Process Burst Time Time Quantum 4ms
  • P1 24 ms
  • P2 3 ms
  • P3 3 ms
  • AWT 5.66, Gantt chart
  • Context switching

9
Multilevel Queue Scheduling
  • Foreground (interactive) processes
  • Background (batch) processes
  • Highest priority
  • System processes
  • Interactive processes
  • Interactive editing processes
  • Batch processes
  • Student processes
  • Lowest priority

10
Multilevel Feedback Queue
  • Most complex scheduling, has to define
  • Number of queues
  • The scheduling algorithm for each queue
  • The method used to determine when to upgrade a
    process to a higher priority queue
  • The method used to determine when to demote a
    process to a lower priority queue
  • The method used to determine which queue a
    process will enter when that process needs
    service
Write a Comment
User Comments (0)
About PowerShow.com