CSE 153 Design of Operating Systems

Similar documents
CS 318 Principles of Operating Systems

Lecture 9: Midterm Review

CS 153 Design of Operating Systems Spring 18

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Midterm Review

CSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo

CSE 120 Principles of Operating Systems

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

Midterm Exam. October 20th, Thursday NSC

CSI3131 Final Exam Review

Last Class: Deadlocks. Today

Operating Systems (1DT020 & 1TT802)

Architectural Support. Processes. OS Structure. Threads. Scheduling. CSE 451: Operating Systems Spring Module 28 Course Review

CSE 120 Principles of Operating Systems Spring 2017

Chendu College of Engineering & Technology

Advanced Operating Systems (CS 202) Scheduling (1)

Department of Computer applications. [Part I: Medium Answer Type Questions]

CMPS 111 Spring 2003 Midterm Exam May 8, Name: ID:

Last Class: Synchronization Problems. Need to hold multiple resources to perform task. CS377: Operating Systems. Real-world Examples

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

Operating Systems: Quiz2 December 15, Class: No. Name:

OS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions).

Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)

Chapter 5: CPU Scheduling

UNIT:2. Process Management

Sample Questions. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

CS 153 Design of Operating Systems Winter 2016

Announcements/Reminders

MARUTHI SCHOOL OF BANKING (MSB)

Processes The Process Model. Chapter 2. Processes and Threads. Process Termination. Process Creation

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

CSE 451: Operating Systems Winter Lecture 7 Synchronization. Steve Gribble. Synchronization. Threads cooperate in multithreaded programs

PROCESSES & THREADS. Charles Abzug, Ph.D. Department of Computer Science James Madison University Harrisonburg, VA Charles Abzug

CPSC/ECE 3220 Summer 2017 Exam 2

Comp 310 Computer Systems and Organization

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System

Lecture 7: CVs & Scheduling

Main Points of the Computer Organization and System Software Module

Tasks. Task Implementation and management

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

CS350: Final Exam Review

CHAPTER NO - 1 : Introduction:

QUESTION BANK UNIT I

CS370 Operating Systems

(MCQZ-CS604 Operating Systems)

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

Operating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

Last Class: Processes

CSE 451: Operating Systems Winter Lecture 7 Synchronization. Hank Levy 412 Sieg Hall

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad COMPUTER SCIENCE AND ENGINEERING QUESTION BANK OPERATING SYSTEMS

Dealing with Issues for Interprocess Communication

Operating Systems Comprehensive Exam. Fall Student ID # 10/31/2013

CS-537: Midterm Exam (Spring 2001)

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

CLASS: II YEAR / IV SEMESTER CSE SUBJECT CODE AND NAME: CS6401 OPERATING SYSTEMS UNIT I OPERATING SYSTEMS OVERVIEW

MC7204 OPERATING SYSTEMS

Maximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait

CS604 - Operating System Solved Subjective Midterm Papers For Midterm Exam Preparation

CSE 120 Principles of Computer Operating Systems Fall Quarter, 2002 Halloween Midterm Exam. Instructor: Geoffrey M. Voelker

CS140 Operating Systems and Systems Programming Midterm Exam

CPU Scheduling. Schedulers. CPSC 313: Intro to Computer Systems. Intro to Scheduling. Schedulers in the OS

Processes The Process Model. Chapter 2 Processes and Threads. Process Termination. Process States (1) Process Hierarchies

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Precept 2: Non-preemptive Scheduler. COS 318: Fall 2018

Operating Systems Comprehensive Exam. Spring Student ID # 2/17/2011

Question No: 1 (Marks: 1) - Please choose one A computer system that allows only one user to use the computer at a given time is known as:

Lecture 5: Synchronization w/locks

Operating System Concepts Ch. 5: Scheduling

Chapter 2 Processes and Threads

CMPS 111 Spring 2013 Prof. Scott A. Brandt Midterm Examination May 6, Name: ID:

Threads. Threads The Thread Model (1) CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5

Concurrency: Deadlock and Starvation

FCM 710: Architecture of Secure Operating Systems

UNIT 2 Basic Concepts of CPU Scheduling. UNIT -02/Lecture 01

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK

Operating System(16MCA24)

COSC243 Part 2: Operating Systems

COMP 300E Operating Systems Fall Semester 2011 Midterm Examination SAMPLE. Name: Student ID:

Exam Guide COMPSCI 386

CS153: Midterm (Fall 16)

Topic 4 Scheduling. The objective of multi-programming is to have some process running at all times, to maximize CPU utilization.

Chapter 6: Process Synchronization

CPU Scheduling Algorithms

Chapter 6 Concurrency: Deadlock and Starvation

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

CSCE Operating Systems Scheduling. Qiang Zeng, Ph.D. Fall 2018

Resource management. Real-Time Systems. Resource management. Resource management

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

1.1 CPU I/O Burst Cycle

Design of Operating System

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

General Objectives: To understand the process management in operating system. Specific Objectives: At the end of the unit you should be able to:

Operating System Review Part

Operating Systems ECE344. Ding Yuan

Transcription:

CSE 153 Design of Operating Systems Winter 2018 Midterm Review

Midterm in class on Monday Covers material through scheduling and deadlock Based upon lecture material and modules of the book indicated on the class schedule Closed book. No additional sheets of notes CSE 153 Midterm Review 2

Overview Architectural support for Oses Processes Threads Synchronization Scheduling CSE 153 Midterm Review 3

Arch Support for OSes Types of architecture support Manipulating privileged machine state Generating and handling events CSE 153 Midterm Review 4

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

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

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

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

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

Threads What is a thread? What is the difference between a thread and a process? How are they related? Why are threads useful? What is the difference between user-level and kernellevel threads? What are the advantages/disadvantages of one over another? CSE 153 Midterm Review 10

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Lets do some problems CSE 153 Midterm Review 25

CSE 153 Midterm Review 26

CSE 153 Midterm Review 27

CSE 153 Midterm Review 28

CSE 153 Midterm Review 29

CSE 153 Midterm Review 30

CSE 153 Midterm Review 31