Operating Systems Structure

Similar documents
MODERN OPERATING SYSTEMS. Third Edition ANDREW S. TANENBAUM. Chapter 6 Deadlocks

Chapter 2 Processes and Threads

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


CISC 7310X. C10: Deadlocks. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/12/2018 CUNY Brooklyn College

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

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

Main Points of the Computer Organization and System Software Module

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

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

COMP 3361: Operating Systems 1 Final Exam Winter 2009

MODERN OPERATING SYSTEMS. Third Edition ANDREW S. TANENBAUM. Chapter 6 Deadlocks

8: Scheduling. Scheduling. Mark Handley

COMP 3361: Operating Systems 1 Midterm Winter 2009

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

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

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

EL6483: Some Additional Concepts of Real-Time Operating Systems

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

CSI3131 Final Exam Review

CHAPTER NO - 1 : Introduction:

CS 153 Design of Operating Systems Winter 2016

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

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Introduction to OS. Deadlock. MOS Ch. 6. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

Concurrency: Deadlock and Starvation

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

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

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

Chapter 4 File Systems

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College

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

Semaphore. Originally called P() and V() wait (S) { while S <= 0 ; // no-op S--; } signal (S) { S++; }

Deadlocks Prof. James L. Frankel Harvard University. Version of 7:05 PM 7-Mar-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

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

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.

Chapter 2 Processes and Threads. Interprocess Communication Race Conditions

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

UNIT:2. Process Management

! What is a deadlock? ! What causes a deadlock? ! How do you deal with (potential) deadlocks? Maria Hybinette, UGA

OS Structure. User mode/ kernel mode. System call. Other concepts to know. Memory protection, privileged instructions

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

2 nd Half. Memory management Disk management Network and Security Virtual machine

Resources. Lecture 4. Deadlocks. Resources (2) Resources (1) Four Conditions for Deadlock. Introduction to Deadlocks

Uniprocessor Scheduling

OS Structure. User mode/ kernel mode (Dual-Mode) Memory protection, privileged instructions. Definition, examples, how it works?

Chapter 3. Deadlocks

CSE 153 Design of Operating Systems

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

Process P holds resource R. Process P is waiting for resource R. P Process P holds T and requests R. R Process Q holds R and requests T

Back to synchronization

Resource Sharing & Management

CS162, Spring 2004 Discussion #6 Amir Kamil UC Berkeley 2/26/04

Lecture 9: Midterm Review

Yet another synchronization problem

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

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Operating systems. Lecture 7 File Systems. Narcis ILISEI, oct 2014

POSIX Threads: a first step toward parallel programming. George Bosilca

MODERN OPERATING SYSTEMS

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

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

!! What is a deadlock? !! What causes a deadlock? !! How do you deal with (potential) deadlocks? Maria Hybinette, UGA

Chapter 7: Deadlocks. Operating System Concepts 9th Edition DM510-14

OpenMP and more Deadlock 2/16/18

File Systems. File system interface (logical view) File system implementation (physical view)

CSE 120. Summer, Inter-Process Communication (IPC) Day 3. Inter-Process Communication (IPC) Scheduling Deadlock. Instructor: Neil Rhodes

Remaining Contemplation Questions

CSE 306/506 Operating Systems Deadlock. YoungMin Kwon

CSE 120 Principles of Operating Systems

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

CS 431 Introduction to Computer Systems Solutions Mid semester exam 2005

The Deadlock Lecture

Chapter 5 Input/Output

Interactive Scheduling

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

CS450/550 Operating Systems

Scheduling. Scheduling. Scheduling. Scheduling Criteria. Priorities. Scheduling

Last Class: Deadlocks. Today

Midterm Exam Amy Murphy 19 March 2003

Scheduling. The Basics

OPERATING SYSTEMS. Prescribed Text Book. Operating System Principles, Seventh Edition. Abraham Silberschatz, Peter Baer Galvin and Greg Gagne

CS450/550 Operating Systems

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Deadlock. Pritee Parwekar

Deadlocks. Thomas Plagemann. With slides from C. Griwodz, K. Li, A. Tanenbaum and M. van Steen

Operating Systems ECE344. Ding Yuan

Silberschatz, Galvin and Gagne 2013! CPU cycles, memory space, I/O devices! " Silberschatz, Galvin and Gagne 2013!

CS450/550 Operating Systems

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

Deadlocks. Deadlock in Resource Sharing Environment. CIT 595 Spring Recap Example. Representing Deadlock

CHAPTER 7: DEADLOCKS. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Operating Systems Prof. Allan Gottlieb Practice Final Exam Page 1 Name

Deadlocks. Tore Larsen. With slides from T. Plagemann, C. Griwodz, K. Li, A. Tanenbaum and M. van Steen

The Deadlock Problem. A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.

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

Spinlocks. Spinlocks. Message Systems, Inc. April 8, 2011

INSTITUTE OF AERONAUTICAL ENGINEERING

Scheduling of processes

Transcription:

Operating Systems Structure Monolithic systems basic structure: A main program that invokes the requested service procedure. A set of service procedures that carry out the system calls. A set of utility procedures that help the service procedures.

Microkernels Figure 1-26. Structure of the MINIX 3 system.

Client-Server Model Figure 1-27. The client-server model over a network.

Virtual Machines Figure 1-29. (a) A type 1 hypervisor. (b) A type 2 hypervisor.

The Classical Thread Model (1) Figure 2-11. (a) Three processes each with one thread. (b) One process with three threads.

POSIX Threads (1) Figure 2-14. Some of the Pthreads function calls.

Mutexes Figure 2-29. Implementation of mutex lock and mutex unlock.

Scheduling in Interactive Systems Round-robin scheduling Priority scheduling Multiple queues Shortest process next Guaranteed scheduling Lottery scheduling Fair-share scheduling

Round-Robin Scheduling Figure 2-41. Round-robin scheduling. (a) The list of runnable processes. (b) The list of runnable processes after B uses up its quantum.

Page Replacement Algorithms Optimal page replacement algorithm Not recently used page replacement First-In, First-Out page replacement Second chance page replacement Clock page replacement Least recently used page replacement Working set page replacement WSClock page replacement

Optimal Page Replacement Sequence of Pages: 1 2 3 4 1 2 5 1 2 3 4 5

FIFO Page Replacement Algorithm Sequence of Pages: 1 2 3 4 1 2 5 1 2 3 4 5

File Systems (2) Think of a disk as a linear sequence of fixed-size blocks and supporting reading and writing of blocks. Questions that quickly arise: How do you find information? How do you keep one user from reading another s data? How do you know which blocks are free?

File Operations The most common system calls relating to files: Create Delete Open Close Read Write Append Seek Get Attributes Set Attributes Rename

Directory Operations System calls for managing directories: Create Delete Opendir Closedir Readdir Rename Link Unlink

File System Layout Figure 4-9. A possible file system layout.

I-nodes Figure 4-13. An example i-node.

Keeping Track of Free Blocks Figure 4-22. (a) Storing the free list on a linked list. (b) A bitmap.

The UNIX V7 File System (2) Figure 4-34. A UNIX i-node.

I/O Devices Figure 5-1. Some typical device, network, and bus data rates.

Introduction To Deadlocks Deadlock can be defined formally as follows: A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause.

Conditions for Resource Deadlocks 1. Mutual exclusion condition 2. Hold and wait condition. 3. No preemption condition. 4. Circular wait condition.

Resource Acquisition (2) Figure 6-2. (a) Deadlock-free code.

Resource Acquisition (3) Figure 6-2. (b) Code with a potential deadlock.

Deadlock Detection with Multiple Resources of Each Type (1) Figure 6-6. The four data structures needed by the deadlock detection algorithm.

Deadlock Detection with Multiple Resources of Each Type (2) Deadlock detection algorithm: 1. Look for an unmarked process, P i, for which the i-th row of R is less than or equal to A. 2. If such a process is found, add the i-th row of C to A, mark the process, and go back to step 1. 3. If no such process exists, the algorithm terminates.

Deadlock Detection with Multiple Resources of Each Type (3) Figure 6-7. An example for the deadlock detection algorithm.

The Banker s Algorithm for Multiple Resources (1) Algorithm for checking to see if a state is safe: 1. Look for row, R, whose unmet resource needs all A. If no such row exists, system will eventually deadlock since no process can run to completion 2. Assume process of row chosen requests all resources it needs and finishes. Mark process as terminated, add all its resources to the A vector. 3. Repeat steps 1 and 2 until either all processes marked terminated (initial state was safe) or no process left whose resource needs can be met (there is a deadlock).

The Banker s Algorithm for Multiple Resources (2) Figure 6-12. The banker s algorithm with multiple resources.