lec7_schedule

lec7_schedule - Announcement CSE120 Principles of Operating...

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 Apr 22 , 2010 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 2 Announcement Homework 2 released Project 1 due on Oct 21 st 10/13/2010 CS 323 - Operating Systems, Yuanyuan Zhou 3 Barriers Use of a barrier processes approaching a barrier all processes but one blocked at barrier last process arrives, all are let through Real life analogy? Problem: Waste CPU if workloads are unbalanced 10/13/2010 CS 323 - Operating Systems, Yuanyuan Zhou 4 Barriers
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 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 5 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 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 6 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. 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 7 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? 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 8 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)
Background image of page 2
3 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 9 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 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 10 What are the scheduling objectives? Anyone? CPU Process 1 Process 2 Process 3 I want to ride it Whose turn is it? 10/13/2010 CSE 120 – Lecture 8 – Scheduling and Deadlock 11 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,
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 12/09/2010 for the course CSE CSE 120 taught by Professor Yuanyuanzhou during the Spring '10 term at UCSD.

Page1 / 11

lec7_schedule - Announcement CSE120 Principles of Operating...

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