CS 162 Discussion Section Week 1 (9/9 – 9/13) 1. Who am I? Kevin Klues Office Hours:

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Slide 2-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 2 Using the Operating System 2.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Computer Systems/Operating Systems - Class 8
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
Operating Systems CS451 Brian Bershad
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Operating Systems and Systems Programming CS162 Teaching Staff.
Computer Science 162 Discussion Section Week 2. Agenda Recap “What is an OS?” and Why? Process vs. Thread “THE” System.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
Computer Science 162 Section 1 CS162 Teaching Staff.
OS Spring’03 Introduction Operating Systems Spring 2003.
1 Chapter 4 Threads Threads: Resource ownership and execution.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
OS Spring’04 Introduction Operating Systems Spring 2004.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Computer Organization
9/13/20151 Threads ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original slides.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
Operating Systems CSE 411 Multi-processor Operating Systems Multi-processor Operating Systems Dec Lecture 30 Instructor: Bhuvan Urgaonkar.
Operating Systems and Systems Programming CS162 Teaching Staff.
CS 162 Discussion Section Week 2. Who am I? Haoyuan (HY) Li Office Hours: 1pm-3pm
CS 162 Discussion Section Week 2. Who am I? Wesley Chow Office Hours: 12pm-2pm 411 Soda Does Monday 1-3 work for everyone?
CS 162 Discussion Section Week 2 (9/16 – 9/20). Who am I? Kevin Klues Office Hours:
Introduction to Operating Systems and Concurrency.
Multithreaded Programing. Outline Overview of threads Threads Multithreaded Models  Many-to-One  One-to-One  Many-to-Many Thread Libraries  Pthread.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
Lecture on Central Process Unit (CPU)
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
12/2/091 What is an Operating System Andy Konwinski CS61CL Dec 2, 2009 Lecture 13 UCB CS61CL F09 Lec 13.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Threads. Readings r Silberschatz et al : Chapter 4.
Goals for Today How do we provide multiprogramming? What are Processes? How are they related to Threads and Address Spaces? Note: Some slides and/or pictures.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
CS 162 Discussion Section Week 2. Who am I? Prashanth Mohan Office Hours: 11-12pm Tu W at.
Welcome to Intro to Operating Systems Course Website:
Introduction to Operating Systems Concepts
Introduction to threads
Processes and threads.
CSCI 511 Operating Systems Chapter 3,4 (Part A) Processes and Threads
Chapter 1: A Tour of Computer Systems
Process Management Presented By Aditya Gupta Assistant Professor
Intro to Processes CSSE 332 Operating Systems
Threads & multithreading
Chapter 4: Threads.
Operating System Concepts
COP 4600 Operating Systems Fall 2010
Operating Systems and Systems Programming
CSCI 511 Operating Systems Chapter 3,4 (Part A) Processes and Threads
Chapter 4: Threads.
Lecture Topics: 11/1 General Operating System Concepts Processes
Threads and Concurrency
Threads Chapter 4.
CSE 451: Operating Systems Winter 2003 Lecture 1 Course Introduction
Prof. Leonardo Mostarda University of Camerino
Operating Systems: A Modern Perspective, Chapter 6
CSE 153 Design of Operating Systems Winter 2019
CSE 451: Operating Systems Autumn 2003 Lecture 1 Course Introduction
Sarah Diesburg Operating Systems CS 3430
Presentation transcript:

CS 162 Discussion Section Week 1 (9/9 – 9/13) 1

Who am I? Kevin Klues Office Hours: 12:30pm-2:30pm Soda 7th Floor Alcove 2

Administrivia… No electronics in section please! Register on Piazza! Possible short Quizzes in Section every week (part of your overall quiz grade for the course) Start getting to know Nachos and setting up your environment (links on course website) Group Signup by 9/12 11:59 PM (This Thursday!) All project members MUST attend same discussion section!! 3

Today’s Section Project Overview and Questions (10 min) Sample Quiz (ungraded) (5 min) Review Lectures 1 and 2 (20 min) Worksheet and Discussion (15 min) 4

Project Goals Learn to work in teams Use good engineering practices – Version control, collaboration – Requirements specification – Design Document – Implementation – Testing – [Performance, reliability,...] analysis Understand lecture concepts at the implementation level

Project Grading Design docs [40 points] – First draft [10 points] – Design review [10 points] – Final design doc [20 points] Code [60 points]

Good Project Lifetime Day 0: Project released on course webpage Day 1 ‐ 13: Team meets, discusses and breaks up work on design and necessary prototyping Day 14: Initial design document due – Team reviews the document with TA Day 15: Implementation begins Day 20: Implementation is finished. Team switches to writing test cases. Design doc has been updated to reflect the implementation. Day 21: Iteration and performance analysis. Day 23: Team puts finishing touches on write up and gets to bed early.

Project 1: Thread Programming

Project 2: Multiprogramming

Project 3: Key Value Store Key Value Store API Application Key 1 Value 1 Key 2 Value 2 Key 3 Value 3 Key 4 Value 4

Project 4: Distributed KV Store Key Value Store API Application Key 1 Value 1 Key 1 Value 1 Key 1 Value 1

Version Control for the Projects Course provided SVN and Private GitHub repos for every group Use whichever you prefer Access: svn: git:

Project Questions?

Sample Quiz 1.(True/False) Threads within the same process share the same heap and stack. 2.(True/False) Preemptive multithreading requires threads to give up the CPU using the yield() system call. 3.(True/False) Despite the overhead of context switching, multithreading can provide speed-up even on a single-core cpu. 4.What is the OS data structure that represents a running process (i.e. holds its current state)? 5.What is the mechanism by which different processes communicate with one another called?

What is an OS and What does it do?

A computer boot sequence Hardware Operating System Memory Mgmt File Systems Scheduler …. BIOS Boot Loader Networks Application T1 T2 T3 T4

Why do you want an OS? Isolation – Fault: “if my program crashes yours shouldn’t” – Performance: “if my program starts to do some massive computation, it shouldn’t starve yours from running” Mediation (multiplexing/sharing + protection) – Manage the sharing of hardware resources (CPU, NIC, RAM, disk, keyboard, sound card, etc) Abstractions and Primitives – Set of constructs and well‐defined interfaces to simplify application development: “all the code you didn’t write” in order to implement your application Because hardware changes faster than applications! Because some concepts are useful across applications

Benefits of having an OS? User benefits – Efficiency (cost and performance) Share one computer across many users Concurrent execution of multiple programs – Safety OS protects programs from each other OS fairly multiplexes resources across programs Application benefits – Simplicity Sockets instead of ethernet cards – Portability Device independence: tiCOM card or Intel card?

Why is concurrency hard? What do you need to get concurrency working?

Concurrency Concurrency means multiple threads of computation can make progress, but possibly by sharing the same processor – Like doing homework while chatting on IM Why Concurrency? – Consider a web server: while it’s waiting for a response from one client, it could read a request for another client – Consider a browser: while it’s waiting for a response from a web server, it wants to react to mouse or keyboard input Concurrency increases/enables responsiveness

Different levels of abstraction Threads Processes Symmetric multithreading Distributed systems (Single system image)

What is a thread? A thread of execution is the smallest unit of processing that can be scheduled by an operating system. – Wikipedia circa Jan ‘12 What resources does a thread have?

Single and Multi Threading

What is the difference between a Thread and a Process?

What is a Process? Process Control Block

Process Address Space Program Address Space What is an address space? What does this mean in terms of hardware?

Operating System Memory Management Prog 1 Virtual Address Space 1 Prog 2 Virtual Address Space 2 Code Data Heap Stack Code Data Heap Stack Data 2 Stack 1 Heap 1 OS heap & Stacks Code 1 Stack 2 Data 1 Heap 2 Code 2 OS code OS data Translation Map 1Translation Map 2 Physical Address Space

When and how do you switch between processes?

Scheduling states

Context Switching

Fetch Exec R0 … R31 F0 … F30 PC … Data1 Data0 Inst237 Inst236 … Inst5 Inst4 Inst3 Inst2 Inst1 Inst0 Addr 0 Addr Recall (61C): What happens during execution? Execution sequence: –Fetch Instruction at PC –Decode –Execute (possibly using registers) –Write results to registers/mem –PC = Next Instruction(PC) –Repeat PC

Questions about the course?

Workseet…