Lec06 - Computer Science Lecture 6, page 1 Computer Science...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Computer Science Lecture 6, page 1 Computer Science CS377: Operating Systems Last Class: Threads and Scheduling Thread: sequential execution stream within a process Kernel threads versus user-level threads Goals for Scheduling: Minimize average response time Maximize throughput Share CPU equally Other goals? Scheduling Algorithms: Selecting a scheduling algorithm is a policy decision Computer Science Lecture 6, page 2 Computer Science CS377: Operating Systems Today: More on Scheduling Algorithms Goals for scheduling FCFS & Round Robin SJF Multilevel Feedback Queues Lottery Scheduling Computer Science Lecture 6, page 3 Computer Science CS377: Operating Systems Short Term Scheduling The kernel runs the scheduler at least when 1. a process switches from running to waiting, 2. an interrupt occurs, or 3. a process is created or terminated. Non-preemptive system : the scheduler must wait for one of these events Preemptive system : the scheduler can interrupt a running process Computer Science Lecture 6, page 4 Computer Science CS377: Operating Systems Criteria for Comparing Scheduling Algorithms CPU Utilization The percentage of time that the CPU is busy. Throughput The number of processes completing in a unit of time. Turnaround time The length of time it takes to run a process from initialization to termination, including all the waiting time. Waiting time The total amount of time that a process is in the ready queue. Response time The time between when a process is ready to run and its next I/O request. Computer Science Lecture 6, page 5 Computer Science CS377: Operating Systems Scheduling Policies Ideally, choose a CPU scheduler that optimizes all criteria simultaneously (utilization, throughput,..), but this is not generally possible Instead, choose a scheduling algorithm based on its ability to satisfy a policy Minimize average response time - provide output to the user as quickly as possible and process their input as soon as it is received. Minimize variance of response time - in interactive systems, predictability may be more important than a low average with a high variance. Maximize throughput - two components minimize overhead (OS overhead, context switching) efficient use of system resources (CPU, I/O devices) Minimize waiting time - give each process the same amount of time on the processor. This might actually increase average response time. Computer Science Lecture 6, page 6 Computer Science CS377: Operating Systems Scheduling Policies Simplifying Assumptions One process per user One thread per process Processes are independent Researchers developed these algorithms in the 70's when these assumptions were more realistic, and it is still an open problem how to relax these assumptions. Computer Science Lecture 6, page 7 Computer Science CS377: Operating Systems Scheduling Algorithms: A Snapshot FCFS: First Come, First Served...
View Full Document

Page1 / 15

Lec06 - Computer Science Lecture 6, page 1 Computer Science...

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

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