Lecture4 - CSCE 313: Introduction to Computer Systems...

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

View Full Document Right Arrow Icon
CSCE 313: Introduction to Computer Systems Spring 2011 Dr. Ronnie Ward
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 Chapter 12 in textbook Some slides adopted and modified from Dr. Bettati.
Background image of page 2
User Level Threads vs Kernel Threads User Level Threads: More efficient management User control of scheduling Operations impact the whole process Kernel Level Threads: Blocking I/O of one thread, does not affect other threads Thread scheduling is fairer—kernel schedules each thread Simplifies use of multiple processors 3 2/14/12
Background image of page 3

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

View Full DocumentRight Arrow Icon
CPU Scheduling Schedulers in the OS Structure of a CPU Scheduler Scheduling = Selection + Dispatching Criteria for scheduling Scheduling Algorithms FIFO/FCFS SJF / SRTF Priority - Based 2/14/12 4
Background image of page 4
Schedulers 5 2/14/12 start blocked ready running suspended ready suspended blocked long-term (admission) scheduler medium-term (memory) scheduler short-term (CPU) scheduler
Background image of page 5

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

View Full DocumentRight Arrow Icon
Schedulers Long-term: which process to admit Medium-term: which process to swap in or out Short-term: which ready process to execute next 6 2/14/12
Background image of page 6
Focus: Short-Term Scheduling Recall: Motivation for multiprogramming -- have multiple processes in memory to keep CPU busy. Typical execution profile of a process/thread: 7 2/14/12 CPU burst wait for I/O CPU burst wait for I/O CPU burst wait for I/O CPU burst start terminate
Background image of page 7

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

View Full DocumentRight Arrow Icon
Focus: Short-Term Scheduling 8 2/14/12
Background image of page 8
Scheduling Decisions “Who is going to use the CPU next?!” Scheduling decision points: 1. The running process changes from running to waiting (current CPU burst of that process is over). 2. The running process terminates. 3. A waiting process becomes ready (new 9 2/14/12 ready running waiting 3 1 2 4 non-preemptive preemptive
Background image of page 9

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

View Full DocumentRight Arrow Icon
Structure of a Scheduler 10 2/14/12 PCB scheduler dispatcher CPU select process start new process ready queue ?
Background image of page 10
Dispatcher Dispatcher module gives control of the CPU to the process selected by the short- term scheduler: 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 11 2/14/12
Background image of page 11

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

View Full DocumentRight Arrow Icon
What Is a Good Scheduler? Criteria
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 / 35

Lecture4 - CSCE 313: Introduction to Computer Systems...

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