COP 4600 Operating Systems Fall 2010

Slides:



Advertisements
Similar presentations
COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM.
Advertisements

COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
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 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
COP 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
COP 5611 Operating Systems Spring 2010 Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM.
CS 162 Discussion Section Week 1 (9/9 – 9/13) 1. Who am I? Kevin Klues Office Hours:
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Operating Systems and Systems Programming CS162 Teaching Staff.
Enforcing Modularity Junehwa Song CS KAIST. Network Computing Lab. How to run multiple modules? Emacs X server Mail Reader File Server.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
COP 5611 Operating Systems Spring 2010 Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM.
1 Advanced Operating Systems - Fall 2009 Lecture 2 – January 12, 2009 Dan C. Marinescu Office: HEC 439 B.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00 – 6:00 PM.
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
CS 162 Discussion Section Week 2. Who am I? Prashanth Mohan Office Hours: 11-12pm Tu W at.
COP 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Process Management Deadlocks.
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Introduction to Operating Systems
COP 4600 Operating Systems Fall 2010
Operating Systems : Overview
COT 4600 Operating Systems Fall 2009
Operating Systems: A Modern Perspective, Chapter 6
Operating Systems and Systems Programming
COP 5611 Operating Systems Spring 2010
COT 5611 Operating Systems Design Principles Spring 2014
COT 4600 Operating Systems Fall 2010
Introduction to Operating Systems
Chapter 7: Deadlocks.
COP 4600 Operating Systems Spring 2011
COP 4600 Operating Systems Spring 2011
COT 5611 Operating Systems Design Principles Spring 2014
CGS 3763 Operating Systems Concepts Spring 2013
HW & Systems: Operating Systems IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, October 22, 2013 Carolyn Seaman University of Maryland, Baltimore.
CGS 3763 Operating Systems Concepts Spring 2013
COT 5611 Operating Systems Design Principles Spring 2012
COT 5611 Operating Systems Design Principles Spring 2014
COP 4600 Operating Systems Fall 2010
Operating Systems : Overview
CGS 3763 Operating Systems Concepts Spring 2013
COP 4600 Operating Systems Spring 2011
COT 4600 Operating Systems Spring 2011
COP 4600 Operating Systems Fall 2010
COT 5611 Operating Systems Design Principles Spring 2012
COT 4600 Operating Systems Fall 2010
Lecture Topics: 11/1 General Operating System Concepts Processes
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
COP 5611 Operating Systems Spring 2010
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems: A Modern Perspective, Chapter 6
CSE 451: Operating Systems Autumn 2004 Module 6 Synchronization
Operating Systems : Overview
Implementing Processes, Threads, and Resources
Outline Operating System Organization Operating System Examples
COP 4600 Operating Systems Fall 2010
CSE 153 Design of Operating Systems Winter 2019
COP 5611 Operating Systems Spring 2010
COT 4600 Operating Systems Fall 2009
COT 5611 Operating Systems Design Principles Spring 2014
Presentation transcript:

COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM

Lecture 15 – Tuesday October 12, 2010 Last time: NFS (Network File System) Virtualization Today: Presentation of the paper “DNS Complexity” by Vixie Threads, Virtual memory, Bounded buffers. Virtual Links. Primitives for processor virtualization Threads. The state of a thread. Thread manager. Interrupts. Interrupt handler. Race conditions and locks. Thread and processor layers Processor sharing; Scheduling; Switching the processor from one thread to another – YIELD. Implementation of YIELD and SCHEDULER Deadlocks Next time Thread coordination with a bounded buffer. Race conditions Lecture 15

Virtualization – relating physical with virtual objects Virtualization  simulating the interface to a physical object by: Multiplexing  create multiple physical objects from one instance of a physical object. Aggregation  create one virtual object from multiple physical objects Emulation  construct a virtual object from a different type of a physical object. Emulation in software is slow. Method Physical Resource Virtual Multiplexing processor thread real memory virtual memory communication channel virtual circuit server (e.g., Web server) Aggregation disk RAID core multi-core processor Emulation RAM disk system (e.g. Macintosh) virtual machine (e.g., Virtual PC) Multiplexing + Emulation real memory + disk virtual memory with paging communication channel + TCP protocol Lecture 15

Virtualization of the three abstractions. (1) Threads Implemented by the operating system for the three abstractions: Threads  a thread is a virtual processor; a module in execution Multiplexes a physical processor The state of a thread: (1) the reference to the next computational step (the Pc register) + (2) the environment (registers, stack, heap, current objects). Sequence of operations: Load the module’s text Create a thread and lunch the execution of the module in that thread. A module may have several threads. The thread manager implements the thread abstraction. Interrupts  processed by the interrupt handler which interacts with the thread manager Exception  interrupts caused by the running thread and processed by exception handlers Interrupt handlers run in the context of the OS while exception handlers run in the context of interrupted thread. Lecture 15

Virtualization of the three abstractions. (2) Virtual memory Virtual Memory  a scheme to allow each thread to access only its own virtual address space (collection of virtual addresses). Why needed: To implement a memory enforcement mechanism; to prevent a thread running the code of one module from overwriting the data of another module The physical memory may be too small to fit an application; otherwise each application would need to manage its own memory. Virtual memory manager maps virtual address space of a thread to physical memory. Thread + virtual memory allow us to create a virtual computer for each module. Each module runs in own address space; if one module runs mutiple threads all share one address space. Lecture 15

Virtualization of the three abstractions: (3) Bounded buffers Bounded buffers  implement the communication channel abstraction Bounded the buffer has a finite size. We assume that all messages are of the same size and each can fit into a buffer cell. A bounded buffer will only accommodate N messages. Threads use the SEND and RECEIVE primitives. Lecture 15

Lecture 15

Lecture 15

Lecture 15

One more pitfall of the previous implementation of bounded buffer If in and out are long integers (64 or 128 bit) then a load requires two registers, e.,g, R1 and R2. int “00000000FFFFFFFF” L R1,int /* R1  00000000 L R2,int+1 /* R2  FFFFFFFF Race conditions could affect a load or a store of the long integer. Lecture 15

Lecture 15

System model Resource types R1, R2, . . ., Rm (CPU cycles, memory space, I/O devices) Each resource type Ri has Wi instances. Resource access model: request use release Lecture 15

Simultaneous conditions for deadlock Mutual exclusion: only one process at a time can use a resource. Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. No preemption: a resource can be released only voluntarily by the process holding it (presumably after that process has finished). Circular wait: there exists a set {P0, P1, …, P0} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn–1 is waiting for a resource that is held by Pn, and P0 is waiting for a resource that is held by P0. Lecture 15

Basic primitives for processor virtualization Memory CREATE/DELETE_ADDRESS SPACE ALLOCATE/FREE_BLOCK MAP/UNMAP UNMAP Interpreter ALLOCATE_THREAD DESTROY_THREAD EXIT_THREAD YIELD AWAIT ADVANCE TICKET ACQUIRE RELEASE Communication channel ALLOCATE/DEALLOCATE_BOUNDED_BUFFER SEND/RECEIVE Lecture 15

Lecture 15

The state of a thread and its associated virtual address space Lecture 15

Thread states and state transitions Lecture 15

Lecture 6 Lecture 15 18

Lecture 15

Implementation of YIELD Lecture 15

Lecture 15

Lecture 15

Lecture 15

Lecture 15