January 15, 2004 Adrienne Noble

Slides:



Advertisements
Similar presentations
Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy.
Advertisements

Processes CSCI 444/544 Operating Systems Fall 2008.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
1/23/2008CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Operating Systems CSE 411 CPU Management Sept Lecture 11 Instructor: Bhuvan Urgaonkar.
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Chapter 2 (PART 1) Light-Weight Process (Threads) Department of Computer Science Southern Illinois University Edwardsville Summer, 2004 Dr. Hiroshi Fujinoki.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Week 3 January 22, 2004 Adrienne Noble. Today CVS – a great tool to use with your groups Threads – basic thread operations Intro to synchronization Hand.
Department of Computer Science and Software Engineering
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
Lecture 5 Page 1 CS 111 Online Process Creation Processes get created (and destroyed) all the time in a typical computer Some by explicit user command.
The Structuring of Systems Using Upcalls David D. Clark (Presented by John McCall)
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Operating System Components) These components reflect the services made available by the O.S. Process Management Memory Management I/O Device Management.
Threads prepared and instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University 1July 2016Processes.
Non Contiguous Memory Allocation
Processes and threads.
Operating Systems CMPSC 473
Chapter 3: Process Concept
CS 6560: Operating Systems Design
CS703 – Advanced Operating Systems
Operating Systems (CS 340 D)
January 29, 2004 Adrienne Noble
Threads and Scheduling
Process Management Presented By Aditya Gupta Assistant Professor
Process Creation Processes get created (and destroyed) all the time in a typical computer Some by explicit user command Some by invocation from other running.
Chapter 3: Process Concept
Chapter 4 Threads.
Intro to Processes CSSE 332 Operating Systems
Threads and Cooperation
Nachos Threads and Concurrency
Lecture 2: Processes Part 1
ICS 143 Principles of Operating Systems
Threads and Data Sharing
CGS 3763 Operating Systems Concepts Spring 2013
Cs561 Presenter: QIAOQIAO CHEN Spring 2012
Lecture 10: Threads Implementation
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Process & its States Lecture 5.
COMS Prelim 1 Review Session
Lecture Topics: 11/1 General Operating System Concepts Processes
Threads and Concurrency
Processes and Process Management
Threads and Concurrency
February 5, 2004 Adrienne Noble
Chapter 3: Processes.
Lecture 10: Threads Implementation
Concurrency: Processes CSE 333 Summer 2018
Operating Systems: A Modern Perspective, Chapter 6
January 8, 2004 Adrienne Noble
Threads vs. Processes Hank Levy 1.
Introduction to Concurrency CSE 333 Autumn 2018
CS510 Operating System Foundations
CSE 153 Design of Operating Systems Winter 19
CSE 153 Design of Operating Systems Winter 2019
Chapter 3: Process Concept
CS703 – Advanced Operating Systems
Light-Weight Process (Threads)
Introduction to Concurrency CSE 333 Winter 2019
Chapter 3: Process Management
Threads CSE 2431: Introduction to Operating Systems
CS Introduction to Operating Systems
Presentation transcript:

January 15, 2004 Adrienne Noble Week 2 January 15, 2004 Adrienne Noble

Questions? Lecture Homework Project – Due tomorrow by 2:30! Mention names when answering questions Office hours: Wednesday 1-2 in 006 Also, feel free to come ask me questions when you see me around the lab – if I happen to be busy, I’ll tell you Lecture: Ed’s been going over a lot of higher level stuff, but realize that you aren’t expected to be experts on threads, critical sections, paging, file systems, etc. We’ll go over most of those in much more detail as the quarter progresses. Just a big overview right now. Homework: probably haven’t started yet, but any questions? Project: stress importance of writeup – almost half of total points Shell: 15 points System call: 15 points Write-up: 25 points

Waiting for I/O Your computer is often waiting on many devices at once: File Socket Keyboard All these devices are represented by a file descriptor A file descriptor (fd) is given to each device so that you can perform operations like reading from that device What are some methods you could use to read these devices when they’re ready?

Polling Just loop around and check each fd Advantages Disadvantages Simple to understand, easy to implement Disadvantages Slow, can only read one fd at a time, doesn’t necessarily read fds in order that they have data available, busy waiting What do I mean by saying it doesn’t read fds in the order that they have data available? What about busy waiting?

Select Give it all the fds, then it blocks and returns when a fd is ready to read Advantages Immediate notification that a fd is ready, no busy waiting Disadvantages Can still only read one at a time You may have seen it in Networks

What is a process? A single instance of a running program Every process has it’s own memory space (static data, stack, heap, and code) Process Control Block (PCB), which holds lots of state information Ask someone to outline the method of creating a new process

Fork (multiple processes) Create a separate process for each fd Advantages Can read multiple fds at once, always knows right away when something is ready, inter-process communication Disadvantages Lots of overhead (in creation and switching), more complicated, expensive communication Are we really doing multiple things at once? No, but the OS switches around a lot What happens when a process is created or switched? Requires flushing the cache and TLB – both expensive operations

What is a thread? Often called a lightweight process Shares many resources with the process Code, heap, etc But has it’s own stack, program counter, and registers Much less expensive to create and switch between Why not always use threads and just get rid of processes completely? Might not always want to share data like threads do

Threads Create a separate thread for each fd Advantages Disadvantages Much less overhead, fast, lightweight, good communication between threads Disadvantages Shared data, more complicated More about project

Project Details Groups of 3 Start early! First part is due two weeks from tomorrow Implement a user thread package Write synchronization primitives for those threads (mutex, condition variables) This weekend might be a good time to get acquainted with the project read the project page looks through the code start designed your thread implementation