CSE 421/521 - Operating Systems Fall Lecture - XXV. Final Review. University at Buffalo

Similar documents
Distributed Deadlock Detection

Final Review. Quiz-5 Solutions. Tevfik Koşar

Announcements. Final Exam. December 10th, Thursday Patrick Taylor Hall. Chapters included in Final. 8.

Midterm Exam. October 20th, Thursday NSC

CSI3131 Final Exam Review

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

King Fahd University of Petroleum and Minerals. Write clearly, precisely, and briefly!!

MC7204 OPERATING SYSTEMS

SYED AMMAL ENGINEERING COLLEGE CS6401- OPERATING SYSTEM

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

QUESTION BANK UNIT I

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

CHAPTER NO - 1 : Introduction:

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

Chendu College of Engineering & Technology

SNS COLLEGE OF ENGINEERING

Main Points of the Computer Organization and System Software Module

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

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Course Description: This course includes the basic concepts of operating system

PESIT SOUTHCAMPUS. Question Bank

COMP 3361: Operating Systems 1 Final Exam Winter 2009


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

INSTITUTE OF AERONAUTICAL ENGINEERING

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

Final Exam Preparation Questions

Fall COMP3511 Review

Operating System(16MCA24)

Department of Information Technology Operating Systems Question Bank YEAR/SEM:III/V

OPERATING SYSTEMS. Sharafat Ibn Mollah Mosharraf TOUCH-N-PASS EXAM CRAM GUIDE SERIES. Students. Special Edition for CSEDU

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

Department of CSIT ( G G University, Bilaspur ) Model Answer 2013 (Even Semester) - AR-7307

CS4411 Intro. to Operating Systems Final Fall points 12 pages

1. Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory

SPOS MODEL ANSWER MAY 2018

Exam Guide COMPSCI 386

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

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

( B ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Shared memory (C) Semaphore (D) Monitor

Institute of Engineering & Management. Course:CS603- Operating System. Course pre-requisites

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

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

Final Review. Geoffrey M. Voelker. Final mechanics Memory management Paging Page replacement Disk I/O File systems Advanced topics

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

CS6401- Operating System QUESTION BANK UNIT-IV

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

Operating Systems (1DT020 & 1TT802)

CS370 Operating Systems

UNIT I. Introduction to OS& System Structures

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

CSE 120 Principles of Operating Systems

1. a. Show that the four necessary conditions for deadlock indeed hold in this example.

CSE 153 Design of Operating Systems

(b) External fragmentation can happen in a virtual memory paging system.

CIS 21 Final Study Guide. Final covers ch. 1-20, except for 17. Need to know:

Interprocess Communication By: Kaushik Vaghani

Retrieval Exercises for CS 3733 Operating Systems. Instructor: Dr. Turgay Korkmaz Department Computer Science The University of Texas at San Antonio

4.1 Paging suffers from and Segmentation suffers from. Ans

OPERATING SYSTEMS ECSE 427/COMP SECTION 01 WEDNESDAY, DECEMBER 7, 2016, 9:00 AM

This exam paper contains 8 questions (12 pages) Total 100 points. Please put your official name and NOT your assumed name. First Name: Last Name:

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

CS4411 Intro. to Operating Systems Final Fall points 10 pages

To Everyone... iii To Educators... v To Students... vi Acknowledgments... vii Final Words... ix References... x. 1 ADialogueontheBook 1

SNS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Contents. 1.1 What Operating Systems Do Computer-System Organization Computer-System Architecture 12. Operating-System Structures

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

Operating System Design

ROEVER ENGINEERING COLLEGE, PERAMBALUR DEPARTMENT OF INFORMATION TECHNOLOGY OPERATING SYSTEMS QUESTION BANK UNIT-I

SAZ4B/SAE5A Operating System Unit : I - V

MARUTHI SCHOOL OF BANKING (MSB)

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

3 rd Year V Semester

Scheduling. The Basics

JBIET. Dept of IT. Operating Systems III B.Tech -I Sem. Department of Information Technology

b. How many bits are there in the physical address?

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK

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

Q1. What is Deadlock? Explain essential conditions for deadlock to occur?

COMP 346 WINTER 2018 MEMORY MANAGEMENT (VIRTUAL MEMORY)

Indian Institute of Technology, Kharagpur

Last Class: Deadlocks. Where we are in the course

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

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

Student Name:.. Student ID... Course Code: CSC 227 Course Title: Semester: Fall Exercises Cover Sheet:

CS 143A - Principles of Operating Systems

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu December 10, Review

Operating Systems. No. 9 ศร ณย อ นทโกส ม Sarun Intakosum

CONTENTS. Computer-System Structures

AC59/AT59/AC110/AT110 OPERATING SYSTEMS & SYSTEMS SOFTWARE DEC 2015

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Operating System Third Year CSE( Sem:I) 2 marks Questions and Answers UNIT I

CS350: Final Exam Review

CMPT 300: Operating Systems I Assignment 4

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Today: Protection! Protection!

Where are we in the course?

Transcription:

CSE 421/521 - Operating Systems Fall 2014 Lecture - XXV Final Review Tevfik Koşar University at Buffalo December 2nd, 2014 1

Final Exam December 4th, Thursday 11:00am - 12:20pm Room: 110 Knox

Chapters included in Final Ch. 3.2-3.4 (Processes) Ch. 4.2-4.6 (Threads) Ch. 6.2-6.3 (CPU Scheduling) Ch. 5.2-5.8 (Synchronization) Ch. 7-2-7.7 (Deadlocks) ~ 20% Ch. 8.1-8.6 (Main Memory) Ch. 9.1-9.6 (Virtual Memory) Ch. 10.1-10.7 (Mass Storage & IO) Ch. 11.3; 12.1-12.5 (File Systems) Ch. 17 & Lect.notes (Distr. Systems) Ch. 15.1-15.5 (Security) ~ 80%

Processes Process Creation & Termination Context Switching Process Control Block (PCB) Process States Process Queues & Scheduling Interprocess Communication 4

Threads Concurrent Programming Threads vs Processes Threading Implementation & Multi-threading Models Other Threading Issues Thread creation & cancellation Signal handling Thread pools Thread specific data 5

CPU Scheduling Scheduling Criteria & Metrics Scheduling Algorithms FCFS, SJF, Priority, Round Robing Preemptive vs Non-preemptive Gantt charts & measurement of different metrics Multilevel Feedback Queues Estimating CPU bursts 6

Synchronization Race Conditions Critical Section Problem Mutual Exclusion Semaphores Monitors Classic Problems of Synchronization Bounded Buffer Readers-Writers Dining Philosophers Sleeping Barber 7

Deadlocks Deadlock Characterization Deadlock Detection Resource Allocation Graphs Wait-for Graphs Deadlock detection algorithm Deadlock Avoidance (Bankers alg. excluded) Deadlock Recovery 8

Main Memory Contiguous Allocation Dynamic Allocation Algorithms Fragmentation Address Binding Address Protection Paging Segmentation 9

Virtual Memory Demand Paging Page Faults Page Replacement Page Replacement Algorithms (FIFO, LRU, SC, LFU, MFU, Optimal) Performance of Demand Paging 10

Mass Storage & I/O Disk Mechanism & Structure Disk Scheduling Algorithms FCFS, SSTF, SCAN, LOOK, C-SCAN, C-LOOK Hierarchical Storage Management RAID Architectures RAID 0-6, RAID 0+1, RAID 1+0 11

File Systems Directory structure & implementation File allocation methods contiguous, linked, indexed Free space management bit vectors, linked lists, grouping, counting 12

Distributed Coordination Event Ordering Happened before relationship Distributed Mutual Exclusion Centralized & Fully Distributed Approaches Distributed Deadlock Prevention Resource Ordering Timestamp Ordering (Wait-die & Wound-wait) Distributed Deadlock Detection Centralized & Fully Distributed Approaches 13

Security Security Violation Categories Security Violation Methods Program & Network Threats Cryptography Symmetric & Asymmetric Encryption Key distribution 14

Main Memory Contiguous Allocation Dynamic Allocation Algorithms Fragmentation Address Binding Address Protection Paging Segmentation 15

Virtual Memory Demand Paging Page Faults Page Replacement Page Replacement Algorithms (FIFO, LRU, SC, LFU, MFU, Optimal) Performance of Demand Paging 16

File Systems Directory structure & implementation File allocation methods contiguous, linked, indexed Free space management bit vectors, linked lists, grouping, counting 17

Mass Storage & I/O Disk Mechanism & Structure Disk Scheduling Algorithms FCFS, SSTF, SCAN, LOOK, C-SCAN, C-LOOK Hierarchical Storage Management RAID Architectures RAID 0-6, RAID 0+1, RAID 1+0 18

Distributed Coordination Event Ordering Happened before relationship Distributed Mutual Exclusion Centralized & Fully Distributed Approaches Distributed Deadlock Prevention Resource Ordering Timestamp Ordering (Wait-die & Wound-wait) Distributed Deadlock Detection Centralized & Fully Distributed Approaches 19

Exercise Questions 20

Question 1 In terms of reliability and performance, compare bit vector implementation of a free block list with keeping a list of free blocks where the first few bytes of each free block provide the logical sector number of the next free block. 21

Remember 22

Solution 1 performance: Bit vector implementation is more efficient since it allows fast and random access to free blocks, linked list approach allows only sequential access, and each access results in a disk read. Bit vector implementation can also find n consecutive free blocks much faster. (Assuming bit vector is kept in memory) reliability: If an item in a linked list is lost, you cannot access the rest of the list. With a bit vectors, only those items are lost. Also, its possible to have multiple copies of the bit vector since it is a more compact representation. Although keeping the bit vector in memory seem to be unreliable, you can always keep an extra copy on the disk. 23

Question 2 Does SSTF disk scheduling algorithm tend to favor accesses to innermost/middle/outermost cylinders of the disk? 24

Question 2 Does SSTF disk scheduling algorithm tend to favor accesses to innermost/middle/outermost cylinders of the disk? Middle cylinders, since these cylinders are, on the average, closest to most other cylinders on the hard drive. 25

Question 3 1 2 10 4 5 6 7 9 8 EX EX Considering the above local wait-for graphs at sites S1 and S2, is the system D in a deadlocked state? If so, which processes are involved in the deadlock? Show how you would check the existence of a deadlock. 26

Question 4 Consider a distributed system which consists of 4 sites given below.! 27

Question 4 (a) Would you use a centralized vs distributed deadlock detection algorithm in this case? How would that algorithm work, shortly describe. 28

Question 4 (a) Would you use a centralized vs distributed deadlock detection algorithm in this case? How would that algorithm work, shortly describe. We would use a centralized algorithm, since each site only keeps the wait-for graph for their local resources [No EX nodes required by the distributed algorithm]. Whenever there is a need to run the deadlock detection algorithm, each site will send their local graphs to the central coordinator, which in turn will generate a single global wait-for graph, and then will run the deadlock detection algorithm on this graph. 29

Question 4 (b) (a) Is the distributed system in a deadlock? If so, please show the cycle. 30

Question 4 (b) Is the distributed system in a deadlock? If so, please show the cycle. The global wait-for graph generated by the coordinator is shown below. As it can be seen, there is cycle involving all nodes. Which means all processes are involved in a deadlock! 31

Question 5 (a) Consider a demand-paged computer system where the degree of multiprogramming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening (in one phrase)? Can you increase the degree of multiprogramming to increase the CPU utilization? a) CPU utilization 86 percent; disk utilization 4 percent. 32

Question 5 (a) Consider a demand-paged computer system where the degree of multiprogramming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening (in one phrase)? Can you increase the degree of multiprogramming to increase the CPU utilization? a) CPU utilization 86 percent; disk utilization 4 percent. Answer: CPU utilization is sufficiently high to leave things alone (there are already sufficient processes running to keep the CPU busy); increasing the degree of multiprogramming may decrease the CPU utilization. 33

Question 5 (b) Consider a demand-paged computer system where the degree of multiprogramming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening (in one phrase)? Can you increase the degree of multiprogramming to increase the CPU utilization? b) CPU utilization 10 percent; disk utilization 95 percent. 34

Question 5 (b) Consider a demand-paged computer system where the degree of multiprogramming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening (in one phrase)? Can you increase the degree of multiprogramming to increase the CPU utilization? b) CPU utilization 10 percent; disk utilization 95 percent. Answer: thrashing is occurring. We cannot increase the CPU utilization 35

Question 5 (c) Consider a demand-paged computer system where the degree of multiprogramming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening (in one phrase)? Can you increase the degree of multiprogramming to increase the CPU utilization? c) CPU utilization 12 percent; disk utilization 2 percent. 36

Question 5 (c) Consider a demand-paged computer system where the degree of multiprogramming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening (in one phrase)? Can you increase the degree of multiprogramming to increase the CPU utilization? c) CPU utilization 12 percent; disk utilization 2 percent. Answer: both CPU and disk utilization are low, and CPU is obviously underutilized. We should increase the degree of multiprogramming to increase CPU utilization. 37

Question 6 (a) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (a) Install a faster CPU. 38

Question 6 (a) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (a) Install a faster CPU. NO. a faster CPU reduces the CPU utilization further since the CPU will spend more time waiting for a process to enter in the ready queue. 39

Question 6 (b) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (b) Install a bigger paging disk. 40

Question 6 (b) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (b) Install a bigger paging disk. NO. the size of the paging disk does not affect the amount of memory that is needed to reduce the page faults. 41

Question 6 (c) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (c) Decrease the degree of multiprogramming. 42

Question 6 (c) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (c) Decrease the degree of multiprogramming. YES. by suspending some of the processes, the other processes will have more frames in order to bring their pages in them, hence reducing the page faults. 43

Question 6 (d) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (d) Install more main memory. 44

Question 6 (d) Consider a demand-paging system with the following time-measured utilization: CPU utilization 18% Paging disk 96% Other I/O devices 6% For each of the following, say whether it will (or is likely to) improve CPU utilization. Answer with YES or NO or LIKELY, and justify your answers. (d) Install more main memory. Likely. more pages can remain resident and do not require paging to or from the disks (i.e. would depend on the page replacement algorithm you are using and the page reference sequence). 45

Consider the paging table on the right. What are the physical addresses of the following logical addresses [p,d] and the words on them : a) 0,0 b) 1,4 c) 2,3 Question 7 46

Consider the paging table on the right. What are the physical addresses of the following logical addresses [p,d] and the words on them : a) 0,0 --> 20 b) 1,4 --> illegal c) 2,3 --> 7 Question 7 47

Question 8 Assume we have a demand-paged memory. It takes 100 ms to service a page fault if an empty page is available or the replaced page is not modified, and 300 ms if the replaced page is modified. Memory access time is 1 ms. Assume that the page to be replaced is modified 80 percent of the time. What is the maximum acceptable page-fault rate for an effective access time of no more than 200% penalty? 48

Question 9 a) r2 happens before p4 : b) p1 happens before r3 : c) p2 happens before r4 : d) p1 and r4 are concurrent processes : e) r1 and p4 are concurrent processes : 49

Question 10 Given the following memory partitions (in kilobytes): 200, 600, 500, 800, 400, 300 (in order); how would each of the first-fit, bestfit, and worst-fit algorithms place processes of 292, 522, 138, 770, 162, 418 (in order). Which algorithm makes the most efficient usage of memory? 50

Question 11 Assume a disk with 500 cylinders is accessing cylinder 100 right now. Prior cylinder 100, the disk head accessed cylinder 101. Further assume that the FIFO queue of pending requests is 102, 20, 450, 60, 80, 220, 330, 250, 101, 190. What order will the pending requests be satisfied using the following scheduling algorithms? (a) Circular Scan disk-scheduling policy? (b) SSTF disk-scheduling policy? (c) Which of the above algorithms is more efficient in this particular case, and why? 51

Question 12 Consider the asymmetric encryption algorithm. You are given two prime numbers: p= 5, q = 7 and assume the public key is given for you: Public key, ke = 5 Suppose we want to send the message, M=27 to you over the network. a) How do we calculate the encrypted message (cyphertext)? 52

b) How would you calculate your private key? c) How do you calculate the decrypted message (cleartext) from the cyphertext? 53