5_sched - CPU Scheduling Chapter 5 1 Outline Basic Concepts...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CPU Scheduling Chapter 5
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Outline Basic Concepts Scheduling Criteria  Scheduling Algorithms Multiple-Processor/Real-Time Scheduling Thread Scheduling Operating Systems Examples Java Thread Scheduling Algorithm Evaluation
Background image of page 2
3 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU  execution and I/O wait CPU burst distribution
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Alternating Sequence of CPU And I/O Bursts
Background image of page 4
5 Histogram of CPU-burst Times
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 CPU Scheduler Selects from among the processes in memory that are ready to execute,  and allocates the CPU to one of them CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state 2.  Switches from running to ready state 3.  Switches from waiting to ready 4.  Terminates Scheduling under 1,4 is nonpreemptive Scheduling under 2,3 is preemptive
Background image of page 6
7 Dispatcher Dispatcher module gives control of the CPU to the process selected by  the short-term scheduler; this involves: switching context switching to user mode jumping to the proper location in the user program to restart that  program Dispatch latency – time it takes for the dispatcher to stop one process  and start another running
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Scheduling Criteria CPU utilization – keep the CPU as busy as possible Throughput – # of processes that complete their execution per  time unit Turnaround time – amount of time to execute a particular  process Waiting time – amount of time a process has been waiting in the  ready queue Response time – amount of time it takes from when a request  was submitted until the first response is produced,  not  output   (for time-sharing environment)
Background image of page 8
9 Optimization Criteria Max CPU utilization Max throughput Min turnaround time  Min waiting time  Min response time
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 Conflicting criteria Minimizing response time requires more context switches for many  processes   incur more scheduling overhead   decrease system throughput Scheduling algorithm depends on nature of system Batch vs. interactive Designing a generic AND efficient scheduler is difficult
Background image of page 10
11 First-Come, First-Served (FCFS) Scheduling Process Burst Time P 1 24  P 2   3  P 3   3   Suppose that the processes arrive in the order: P 1  , P 2  , P 3   The Gantt Chart for the schedule is: Waiting time for P 1   = 0; P 2   = 24; P = 27 Average waiting time:  (0 + 24 + 27)/3 = 17 P 1 P 2 P 3 24 27 30 0
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12 FCFS Scheduling (Cont.) Suppose that the processes arrive in the order  P 2  , P 3  , P 1   The Gantt chart for the schedule is:
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 43

5_sched - CPU Scheduling Chapter 5 1 Outline Basic Concepts...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online