240-323, Part II CPU Scheduling - PowerPoint PPT Presentation

Loading...

PPT – 240-323, Part II CPU Scheduling PowerPoint presentation | free to download - id: 1cb2f6-ZDc1Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

240-323, Part II CPU Scheduling

Description:

The basic problem is as follows: How can OS schedule the ... time quantum , time slice = small unit of time. Process Burst Time. P1 24. P2 3. P3 3 ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 17
Provided by: CSDL3
Learn more at: http://fivedots.coe.psu.ac.th
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: 240-323, Part II CPU Scheduling


1
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
240-323, Part II CPU Scheduling
2
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Basic Concepts
The basic problem is as follows How can OS
schedule the allocation of CPU cycles to
processes in system, to achieve good
performance? Scheduling is a fundamental OS
function.
3
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
CPU- I/O Burst Cycle
cpu burst I/O burst cpu burst I/O burst CPU
burst I/O burst
4
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Preemptive Scheduling
  • process switches from running -gt waiting
  • (I/O request, .. )
  • process switches from running -gt ready
  • (interrupt occur)
  • process switches from waiting -gt ready
  • (completion of I/O)
  • process terminate

5
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Dispatcher
Module to give control of CPU to process
selected by short-term scheduler. This function
involves - Switching context - Switching to
user mode - Jumping to the proper location in
user program to restart that program
6
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Criteria
  • CPU utilization in a real system, it range
    from
  • 40 - 90 percents.
  • Throughput number of processes that are
    completed.
  • Turnaround time interval from time of
    submission to
  • completion.
  • Waiting time time that a process spends
    waiting in
  • ready queue.
  • Response time time from the submission of a
    request
  • until the first response.

7
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithms
  • First-come, First-served Scheduling (FCFS)
  • mange with FIFO

Process Burst Time P1 24 P2 3 P3 3
Average wait time 17
8
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
FCFS
Process Burst Time P1 24 P2 3 P3 3
Average wait time 3
9
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithm
  • Shortest-Job-First Scheduling
  • mange with SJF , minimum average wait time

Process Burst Time P1 6 P2 8
P3 7 P4 3
Average wait time 7
10
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithm
  • Shortest-remaining-time-First Scheduling
  • mange with SJF , minimum average wait time

Process Arrival time Burst Time P1 0 8
P2 1 4 P3 2 9 P4 3 5
P1 P2 P4 P1 P3
0 1 5 10 17 26
Average wait time 6.5
11
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithm
  • Priority Scheduling
  • scheduling in term of high priority and low.

Process Burst Time Priority P1 10 3
P2 1 1 P3 2 3 P4 1 4
P5 5 2
Average wait time 8.2
12
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithm
  • Round-Robin Scheduling
  • round-robin (RR), especially for time-sharing.
  • - time quantum , time slice small unit of time

Process Burst Time P1 24 P2 3 P3 3
If time quantum 4
Average wait time 5.66
13
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithm
  • Multilevel Queue Scheduling

Highest priority
System process
Interactive process
Interactive editing process
Bath process
student process
lowest priority
14
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithm
  • Multilevel Feedback Queue Scheduling

15
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Scheduling Algorithm
Do the example
Process Burst Time Priority Arrival time
P1 10 3 0 P2 5 1 2 P3 4 3 3
P4 1 4 5 P5 3 2 7
16
Department of Computer Engineering,
PSU Wannarat Suntiamorntut
Next Lecture in Process Synchronization
About PowerShow.com