CS444/CS544 Operating Systems Threads Introduction to CPU Scheduling 2/02/2006 Prof. Searleman

Slides:



Advertisements
Similar presentations
Scheduling Introduction to Scheduling
Advertisements

Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Scheduling CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Threads.
CPU Scheduling Section 2.5.
Chapter 5 Processes and Threads Copyright © 2008.
CS444/CS544 Operating Systems Scheduling 1/31/2007 Prof. Searleman
1 Thursday, June 15, 2006 Confucius says: He who play in root, eventually kill tree.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Chapter 4: Multithreaded Programming. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Objectives To introduce a notion of a thread.
Process Concept An operating system executes a variety of programs
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Chapter 4: Threads READ 4.1 & 4.2 NOT RESPONSIBLE FOR 4.3 &
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 4: Threads Overview Multithreading Models Threading Issues.
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 4: Threads.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Chapter 4: Threads. 4.2 Chapter 4: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads.
Silberschatz, Galvin and Gagne ©2011Operating System Concepts Essentials – 8 th Edition Chapter 4: Threads.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
1 CSE451 Scheduling Autumn 2002 Gary Kimura Lecture #6 October 11, 2002.
5: CPU Scheduling Last Modified: 10/25/2015 8:16:31 PM.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 4: Threads Overview Multithreading Models Threading Issues.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 4: Threads Modified from the slides of the text book. TY, Sept 2010.
Lecture 3 Threads Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Processes & Threads Introduction to Operating Systems: Module 5.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Processor Scheduling Hank Levy. 22/4/2016 Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and thruput by overlapping.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Introduction to threads
lecture 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5a: CPU Scheduling
Networks and Operating Systems: Exercise Session 2
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Chapter 5: Threads Overview Multithreading Models Threading Issues
Chapter 4: Multithreaded Programming
April 6, 2001 Gary Kimura Lecture #6 April 6, 2001
Section 10: Last section! Final review.
Chapter 2.2 : Process Scheduling
Threads & multithreading
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 4: Threads.
CPU Scheduling Basic Concepts Scheduling Criteria
Lecture 21: Introduction to Process Scheduling
TDC 311 Process Scheduling.
Operating systems Process scheduling.
CPU scheduling decisions may take place when a process:
Process Scheduling Decide which process should run and for how long
Threads Chapter 5 2/17/2019 B.Ramamurthy.
Threads Chapter 5 2/23/2019 B.Ramamurthy.
CSE 451: Operating Systems Winter 2003 Lecture 6 Scheduling
Lecture 21: Introduction to Process Scheduling
Processor Scheduling Hank Levy 1.
Outline Announcement Process Scheduling– continued
Q:(a)Describe the action for a kernel to context switching for threads (b)why it is faster than processes?
Scheduling 21 May 2019.
CSE 153 Design of Operating Systems Winter 2019
CSE 451: Operating Systems Winter 2001 Lecture 6 Scheduling
Presentation transcript:

CS444/CS544 Operating Systems Threads Introduction to CPU Scheduling 2/02/2006 Prof. Searleman

Outline Laboratory exercise: PThreads CPU scheduling NOTE: Quiz: Thursday, 2/9, in lab (ITL) Covers material in SGG: Chapters New due date for Lab#1: Tuesday, Feb. 7 Read: Chapter 5

Thread Support Pthreads is a user-level thread library Can use multiple kernel threads to implement it on platforms that have kernel threads Java threads (extend Thread class) run by the Java Virtual Machine Kernel threads Linux has kernel threads (each has its own task_struct) – created with clone system call Each user level thread maps to a single kernel thread (Windows 95/98/NT/2000/XP, OS/2) Many user level threads can map onto many kernel level threads like scheduler activations (Windows NT/2000 with ThreadFiber package, Solaris 2)

Scheduling Policy We’ve talked about the context switch mechanism How we change which process or thread is executing on the CPU Today, we will talk about scheduling policies How do we choose which process or thread to execute next Unit of scheduling = process or thread

Scheduler Scheduler = the module that moves jobs from queue to queue Scheduler typically runs when: A process/thread blocks on a request (transitions from running to waiting) A timer interrupt occurs A new process/thread is created or is terminated

Scheduling Algorithm The scheduling algorithm examines the set of candidate processes/threads and chooses one to execute Scheduling algorithms can have different goals Maximize CPU utilization Maximize throughput (#jobs/time) Minimize average turnaround time ( Avg(EndTime – StartTime) ) Minimize response time Recall: Batch systems have which goal? Interative systems have which goal?

Starvation Starvation = process is prevented from making progress towards completion because another process has a resource that it needs Scheduling policies should try to prevent starvation E.g. Even low priority processes should eventually get some time on the CPU

Brainstorm What are some different ways to schedule access to a resource? First Come First Serve Many services humans use are like this? Prefer Short Jobs Express lane at the grocery store Important Jobs First Order you do your TODO list? Maybe round robin? Now what about scheduling processes?