lec7_schedule

lec7_schedule - Scheduling Overview CSE120 Principles of...

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

View Full Document Right Arrow Icon
1 CSE120 Principles of Operating Systems Prof Yuanyuan (YY) Zhou Lecture 7: Scheduling Apr 18 , 2011 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 2 Scheduling Overview In discussing process management and synchronization, we talked about context switching among processes/threads on the ready queue But we have glossed over the details of exactly which thread is chosen from the ready queue Making this decision is called scheduling In this lecture, we’ll look at: The goals of scheduling Starvation Various well-known scheduling algorithms Standard Unix scheduling algorithm 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 3 Multiprogramming In a multiprogramming system, we try to increase CPU utilization and job throughput by overlapping I/O and CPU activities Doing this requires a combination of mechanisms and policy We have covered the mechanisms Context switching, how and when it happens Process queues and process states Now we’ll look at the policies Which process (thread) to run, for how long, etc. We’ll refer to schedulable entities as jobs (standard usage) – could be processes, threads, people, etc. 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 4 Scheduling Deciding which process/thread should occupy the resource (CPU, disk, etc) (CPU) Process 1 Process 2 Process 3 I want to play it Whose turn is it?
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 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 5 When to schedule? A new process starts The running process exits The running process is blocked I/O interrupt (some processes will be ready) Clock interrupt (every 10 milliseconds) 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 6 Preemptive vs. Non-preemptive Non-preemptive scheduling: The running process keeps the CPU until it voluntarily gives up the CPU process exits switches to blocked state 1and 4 only (no 3) Preemptive scheduling : The running process can be interrupted and must release the CPU (can be forced to give up CPU) Running Terminated Ready Blocked 1 4 3 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 7 What are the scheduling objectives? Anyone? CPU Process 1 Process 2 Process 3 I want to ride it Whose turn is it? 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 8 Scheduling Objectives Fair (nobody cries) Priority (lady first) Efficiency (make best use of equipment) Encourage good behavior (good boy/girl) Support heavy loads (degrade gracefully) Adapt to different environments (interactive, real-time, multi-media)
Background image of page 2
3 4/18/2011 CSE 120 – Lecture 8 – Scheduling and Deadlock 9 Performance Criteria Fairness Efficiency : keep resources as busy as possible Throughput : # of processes that completes in unit time Turnaround Time (also called elapse time) amount of time to execute a particular process from the time its entered Waiting Time amount of time process has been waiting in ready queue Response Time
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/26/2012 for the course CSE 120 taught by Professor Staff during the Spring '08 term at UCSD.

Page1 / 11

lec7_schedule - Scheduling Overview CSE120 Principles of...

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

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