Lecture 4 Scheduling

Lecture 4 Scheduling - Administrivia Remember send email...

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

View Full Document Right Arrow Icon
Administrivia Remember send email for any course staff to: cs140-staff@scs.stanford.edu - cs140-staff gets priority than my personal mailbox Assignment 1 due one week from now Please, please, please turn in your own work - Most of you would never think of cheating, and I apologize that I even have to bring this up - 50% of honor-code violations are in CS, numbers up this year - If you are in trouble, ask for extensions, ask for help - But if you copy code, we have to turn it over to Judicial Affairs - If you copy code, re-format, re-name variables, etc., you will still be caught. See MOSS for some of theory behind this. 1/36
Background image of page 1

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

View Full DocumentRight Arrow Icon
CPU Scheduling The scheduling problem: - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s) When do we make decision? 2/36
Background image of page 2
CPU Scheduling 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. Exits Preemptive schedulers run at all four points 3/36
Background image of page 3

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

View Full DocumentRight Arrow Icon
Scheduling criteria Why do we care? - What goals should we have for a scheduling algorithm? 4/36
Background image of page 4
Scheduling criteria Why do we care? - What goals should we have for a scheduling algorithm? Throughput – # of procs that complete per unit time - Higher is better Turnaround time – time for each proc to complete - Lower is better Response time – time from request to Frst response (e.g., key press to character echo, not launch to exit) - Lower is better Above criteria are affected by secondary criteria - CPU utilization – keep the CPU as busy as possible - Waiting time – time each proc waits in ready queue 4/36
Background image of page 5

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

View Full DocumentRight Arrow Icon
Example: FCFS Scheduling Run jobs in order that they arrive - Called “ First-come frst-served ” (FCFS) - E.g. ., Say P 1 needs 24 sec, while P 2 and P 3 need 3. - Say P 2 , P 3 arrived immediately after P 1 , get: Dirt simple to implement—how good is it? Throughput: 3 jobs / 30 sec = 0.1 jobs/sec Turnaround Time: P 1 : 24 , P 2 : 27 , P 3 : 30 - Average TT: ( 24 + 27 + 30 ) /3 = 27 Can we do better? 5/36
Background image of page 6
FCFS continued Suppose we scheduled P 2 , P 3 , then P 1 - Would get: Throughput: 3 jobs / 30 sec = 0.1 jobs/sec Turnaround time: P 1 : 30 , P 2 : 3 , P 3 : 6 - Average TT: ( 30 + 3 + 6 ) /3 = 13 – much less than 27 Lesson: scheduling algorithm can reduce TT - Minimizing waiting time can improve RT and TT What about throughput? 6/36
Background image of page 7

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

View Full DocumentRight Arrow Icon
CPU is one of several devices needed by users’ jobs - CPU runs compute jobs, Disk drive runs disk jobs, etc. - With network, part of job may run on remote CPU Scheduling 1-CPU system with n I/O devices like scheduling asymmetric n + 1 -CPU multiprocessor - Result: all I/O devices + CPU busy = n+1 fold speedup! - Overlap them just right? throughput will be almost doubled
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/13/2010 for the course CS 02523 taught by Professor Davidmieres during the Winter '10 term at A.T. Still University.

Page1 / 41

Lecture 4 Scheduling - Administrivia Remember send email...

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

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