CSE 153 Design of Operating Systems Winter 2015 Midterm Review.

Slides:



Advertisements
Similar presentations
Operating Systems ECE344 Midterm review Ding Yuan
Advertisements

CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
Chapter 6: Process Synchronization
Operating Systems ECE344 Ding Yuan Final Review Lecture 13: Final Review.
Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy.
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
Chapter 2: Processes Topics –Processes –Threads –Process Scheduling –Inter Process Communication (IPC) Reference: Operating Systems Design and Implementation.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
1 Concurrency: Deadlock and Starvation Chapter 6.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
CS 153 Design of Operating Systems Spring 2015 Lecture 10: Scheduling.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
General What is an OS? What do you get when you buy an OS? What does the OS do? What are the parts of an OS? What is the kernel? What is a device.
Exam Review Operating Systems CS 550. Items of Interest Exam is Nov. 19, 2014 Focus on material since last exam, though knowledge of initial material.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Processes and Threads.
CS 153 Design of Operating Systems Spring 2015 Midterm Review.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
CS 153 Design of Operating Systems Spring 2015 Lecture 11: Scheduling & Deadlock.
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
Lecture Topics: 11/13 Semaphores Deadlock Scheduling.
Operating Systems Lecture Notes CPU Scheduling Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
1 CSE451 Scheduling Autumn 2002 Gary Kimura Lecture #6 October 11, 2002.
Cpr E 308 Spring 2004 Real-time Scheduling Provide time guarantees Upper bound on response times –Programmer’s job! –Every level of the system Soft versus.
Chapter 1 Computer System Overview Sections 1.1 to 1.6 Instruction exe cution Interrupt Memory hierarchy Cache memory Locality: spatial and temporal Problem.
CSE 451: Operating Systems Section 5 Midterm review.
Operating Systems ECE344 Ding Yuan Final Review Lecture 13: Final Review.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Review for Quiz-2 Applied Operating System Concepts Chap.s 1,2,6,7 - ECE3055b, Spring 2005.
Exam Review Andy Wang Operating Systems COP 4610 / CGS 5765.
Silberschatz and Galvin  Chapter 3:Processes Processes –State of a process, process control block, –Scheduling of processes  Long term scheduler,
1/31/20161 Final Exam Dec 10. Monday. 4-7pm. Phelp 1160 Similar to midterm The exam is closed book. You can bring 2 page of notes (double sided) Nachos.
IT 344: Operating Systems Winter 2010 Module 23 Course Review Chia-Chi Teng CTB 265.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
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.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Introduction to operating systems What is an operating system? An operating system is a program that, from a programmer’s perspective, adds a variety of.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
CSE 120 Principles of Operating
Sarah Diesburg Operating Systems COP 4610
Applied Operating System Concepts -
April 6, 2001 Gary Kimura Lecture #6 April 6, 2001
Section 10: Last section! Final review.
Chapter 15 – Part 1 The Internal Operating System
CSE 451: Operating Systems Winter 2007 Module 24 Course Review
Midterm review: closed book multiple choice chapters 1 to 9
COMS Prelim 1 Review Session
CSE 451: Operating Systems Spring 2005 Module 23 Course Review
Lecture 2 Part 2 Process Synchronization
CSE 451: Operating Systems Spring 2005 Module 23 Course Review
Process Scheduling Decide which process should run and for how long
February 5, 2004 Adrienne Noble
CSE 451: Operating Systems Winter 2006 Module 24 Course Review
CSE 451: Operating Systems Autumn 2003 Lecture 7 Synchronization
CSE 451: Operating Systems Autumn 2005 Lecture 7 Synchronization
CSE 451: Operating Systems Winter 2004 Module 6 Synchronization
CSE 451: Operating Systems Winter 2003 Lecture 7 Synchronization
CSE 153 Design of Operating Systems Winter 19
CSE 153 Design of Operating Systems Winter 2019
CSE 153 Design of Operating Systems Winter 2019
EECE.4810/EECE.5730 Operating Systems
CSE 542: Operating Systems
CSE 542: Operating Systems
Sarah Diesburg Operating Systems CS 3430
Presentation transcript:

CSE 153 Design of Operating Systems Winter 2015 Midterm Review

CSE 153 – Midterm Review2 Midterm l in class on Tuesday l Covers material through scheduling and deadlock l Based upon lecture material and Chapters 1 to 7 u Closed book. No additional sheets of notes

CSE 153 – Midterm Review3 Overview l Architectural support for Oses l Processes l Threads l Synchronization l Scheduling

CSE 153 – Midterm Review4 Arch Support for OSes l Types of architecture support u Manipulating privileged machine state u Generating and handling events

CSE 153 – Midterm Review5 Privileged Instructions l What are privileged instructions? u Who gets to execute them? u How does the CPU know whether they can be executed? u Difference between user and kernel mode l Why do they need to be privileged? l What do they manipulate? u Protected control registers u Memory management u I/O devices

CSE 153 – Midterm Review6 Events l Events u Synchronous: faults (exceptions), system calls u Asynchronous: interrupts l What are faults, and how are they handled? l What are system calls, and how are they handled? l What are interrupts, and how are they handled? u How do I/O devices use interrupts? l What is the difference between exceptions and interrupts?

CSE 153 – Midterm Review7 Processes l What is a process? l What resource does it virtualize? l What is the difference between a process and a program? l What is contained in a process?

CSE 153 – Midterm Review8 Process Data Structures l Process Control Blocks (PCBs) u What information does it contain? u How is it used in a context switch? l State queues u What are process states? u What is the process state graph? u When does a process change state? u How does the OS use queues to keep track of processes?

CSE 153 – Midterm Review9 Process Manipulation l What does CreateProcess on Windows do? l What does fork() on Unix do? u What does it mean for it to “return twice”? l What does exec() on Unix do? u How is it different from fork? l How are fork and exec used to implement shells?

CSE 153 – Midterm Review10 Threads l What is a thread? u What is the difference between a thread and a process? u How are they related? l Why are threads useful? l What is the difference between user-level and kernel- level threads? u What are the advantages/disadvantages of one over another?

CSE 153 – Midterm Review11 Thread Implementation l How are threads managed by the run-time system? u Thread control blocks, thread queues u How is this different from process management? l What operations do threads support? u Fork, yield, sleep, etc. u What does thread yield do? l What is a context switch? l What is the difference between non-preemptive scheduling and preemptive thread scheduling? u Voluntary and involuntary context switches

CSE 153 – Midterm Review12 Synchronization l Why do we need synchronization? u Coordinate access to shared data structures u Coordinate thread/process execution l What can happen to shared data structures if synchronization is not used? u Race condition u Corruption u Bank account example l When are resources shared? u Global variables, static objects u Heap objects

CSE 153 – Midterm Review13 Mutual Exclusion l What is mutual exclusion? l What is a critical section? u What guarantees do critical sections provide? u What are the requirements of critical sections? »Mutual exclusion (safety) »Progress (liveness) »Bounded waiting (no starvation: liveness) »Performance l How does mutual exclusion relate to critical sections? l What are the mechanisms for building critical sections? u Locks, semaphores, monitors, condition variables

CSE 153 – Midterm Review14 Locks l What does Acquire do? l What does Release do? l What does it mean for Acquire/Release to be atomic? l How can locks be implemented? u Spinlocks u Disable/enable interrupts l How does test-and-set work? u What kind of lock does it implement? l What are the limitations of using spinlocks, interrupts? u Inefficient, interrupts turned off too long

CSE 153 – Midterm Review15 Semaphores l What is a semaphore? u What does Wait/P/Decrement do? u What does Signal/V/Increment do? u How does a semaphore differ from a lock? u What is the difference between a binary semaphore and a counting semaphore? l When do threads block on semaphores? l When are they woken up again? l Using semaphores to solve synchronization problems u Readers/Writers problem u Bounded Buffers problem

CSE 153 – Midterm Review16 Monitors l What is a monitor? u Shared data u Procedures u Synchronization l In what way does a monitor provide mutual exclusion? u To what extent is it provided? l How does a monitor differ from a semaphore? l How does a monitor differ from a lock? l What kind of support do monitors require? u Language, run-time support

CSE 153 – Midterm Review17 Condition Variables l What is a condition variable used for? u Coordinating the execution of threads u Not mutual exclusion l Operations u What are the semantics of Wait? u What are the semantics of Signal? u What are the semantics of Broadcast? l How are condition variables different from semaphores?

CSE 153 – Midterm Review18 Implementing Monitors l What does the implementation of a monitor look like? u Shared data u Procedures u A lock for mutual exclusion to procedures (w/ a queue) u Queues for the condition variables l What is the difference between Hoare and Mesa monitors? u Semantics of signal (whether the woken up waiter gets to run immediately or not) u What are their tradeoffs? u What does Java provide?

CSE 153 – Midterm Review19 Scheduling l What kinds of scheduling is there? u Long-term scheduling u Short-term scheduling l Components u Scheduler (dispatcher) l When does scheduling happen? u Job changes state (e.g., waiting to running) u Interrupt, exception u Job creation, termination

CSE 153 – Midterm Review20 Scheduling Goals l Goals u Maximize CPU utilization u Maximize job throughput u Minimize turnaround time u Minimize waiting time u Minimize response time l What is the goal of a batch system? l What is the goal of an interactive system?

CSE 153 – Midterm Review21 Starvation l Starvation u Indefinite denial of a resource (CPU, lock) l Causes u Side effect of scheduling u Side effect of synchronization l Operating systems try to prevent starvation

CSE 153 – Midterm Review22 Scheduling Algorithms l What are the properties, advantages and disadvantages of the following scheduling algorithms? u First Come First Serve (FCFS)/First In First Out (FIFO) u Shortest Job First (SJF) u Priority u Round Robin u Multilevel feedback queues l What scheduling algorithm does Unix use? Why?

CSE 153 – Midterm Review23 Deadlock l Deadlock happens when processes are waiting on each other and cannot make progress l What are the conditions for deadlock? u Mutual exclusion u Hold and wait u No preemption u Circular wait l How to visualize, represent abstractly? u Resource allocation graph (RAG) u Waits for graph (WFG)

CSE 153 – Midterm Review24 Deadlock Approaches l Dealing with deadlock u Ignore it u Prevent it (prevent one of the four conditions) u Avoid it (have tight control over resource allocation) u Detect and recover from it l What is the Banker’s algorithm? u Which of the four approaches above does it implement?

Lets do some problems CSE 153 – Midterm Review25

CSE 153 – Midterm Review26

CSE 153 – Midterm Review27

CSE 153 – Midterm Review28

CSE 153 – Midterm Review29

CSE 153 – Midterm Review30

CSE 153 – Midterm Review31