System Software. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 13

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

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

Ruby: Introduction, Basics

CSE Traditional Operating Systems deal with typical system software designed to be:

Concurrency. Chapter 5

Process Management And Synchronization

Ruby: Introduction, Basics

Lecture Topics. Announcements. Today: Concurrency (Stallings, chapter , 5.7) Next: Exam #1. Self-Study Exercise #5. Project #3 (due 9/28)

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Dealing with Issues for Interprocess Communication

Interprocess Communication By: Kaushik Vaghani

Resource Allocation. Pradipta De

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

Midterm Exam. October 20th, Thursday NSC

CHAPTER 6: PROCESS SYNCHRONIZATION

Concept of a process

148 PROCESSES CHAP. 2

2. The shared resource(s) in the dining philosophers problem is(are) a. forks. b. food. c. seats at a circular table.

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles

CSC501 Operating Systems Principles. Process Synchronization

Chapter 2 Processes and Threads. Interprocess Communication Race Conditions

CS450/550 Operating Systems

CS3502 OPERATING SYSTEMS

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

CS450/550 Operating Systems

Concurrency pros and cons. Concurrent Programming Problems. Linked list example. Linked list example. Mutual Exclusion. Concurrency is good for users

Process Synchronization. studykorner.org

Synchronization Principles II

CSE 4/521 Introduction to Operating Systems

Classical Synchronization Problems. Copyright : University of Illinois CS 241 Staff 1

Introduction to Operating Systems

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

Chapter 5 Concurrency: Mutual Exclusion and Synchronization

Main Points of the Computer Organization and System Software Module

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

MARUTHI SCHOOL OF BANKING (MSB)

CSI3131 Final Exam Review

Deadlocks. Copyright : University of Illinois CS 241 Staff 1

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

Chapters 5 and 6 Concurrency

Semaphores. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

OS Process Synchronization!

Process Synchronization

Ruby: Introduction, Basics

Process Coordination

High Performance Computing Lecture 21. Matthew Jacob Indian Institute of Science

CSE 153 Design of Operating Systems

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

Contribution:javaMultithreading Multithreading Prof. Dr. Ralf Lämmel Universität Koblenz-Landau Software Languages Team

Sections 01 (11:30), 02 (16:00), 03 (8:30) Ashraf Aboulnaga & Borzoo Bonakdarpour

5 Classical IPC Problems

PROCESS SYNCHRONIZATION

Deadlock and Monitors. CS439: Principles of Computer Systems September 24, 2018

Concurrency Terminology

Roadmap. Readers-Writers Problem. Readers-Writers Problem. Readers-Writers Problem (Cont.) Dining Philosophers Problem.

Process Synchronization

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

Concurrency pros and cons. Concurrent Programming Problems. Mutual Exclusion. Concurrency is good for users

Concurrent Object Oriented Languages

CMSC 330: Organization of Programming Languages. Concurrency & Multiprocessing

Process Synchronization. Mehdi Kargahi School of ECE University of Tehran Spring 2008

Chapter 6: Process Synchronization. Operating System Concepts 9 th Edit9on

Synchronization Principles

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

IV. Process Synchronisation

Chapter 7: Process Synchronization!

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Starvation and Deadlock

Semaphores (by Dijkstra)

Concurrency: Deadlock and Starvation. Chapter 6

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Synchronization. CSE 2431: Introduction to Operating Systems Reading: Chapter 5, [OSC] (except Section 5.10)

Operating System Design

CS 4410 Operating Systems. Review 1. Summer 2016 Cornell University

Introduction to Linear-Time Temporal Logic. CSE 814 Introduction to LTL

Chapter 6: Process Synchronization

Operating Systems. Thread Synchronization Primitives. Thomas Ropars.

Semaphores. To avoid busy waiting: when a process has to wait, it will be put in a blocked queue of processes waiting for the same event

Semaphores. Semaphores. Semaphore s operations. Semaphores: observations

Semaphores. Otto J. Anshus University of {Tromsø, Oslo}

CS370 Operating Systems

Chendu College of Engineering & Technology

Ver teil tes Rechnen und Parallelprogrammierung: Introduction to Multi-Threading in Java

Interprocess Communication and Synchronization

Chapter 2 Processes and Threads

Dept. of CSE, York Univ. 1

MULTITHREADING AND SYNCHRONIZATION. CS124 Operating Systems Fall , Lecture 10

CS399 New Beginnings. Jonathan Walpole

Operating System Overview

Process Synchronization: Semaphores. CSSE 332 Operating Systems Rose-Hulman Institute of Technology

Announcement. Exercise #2 will be out today. Due date is next Monday

Lesson 6: Process Synchronization

Chapter 6: Process Synchronization. Operating System Concepts 8 th Edition,

Lecture 9: Midterm Review

Lesson 1. Concurrency. Terminology Concurrency in Systems Problem Examples Copyright Teemu Kerola 2009

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

Synchronization. Peter J. Denning CS471/CS571. Copyright 2001, by Peter Denning

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

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Chapter 6: Process Synchronization

Transcription:

System Software Computer Science and Engineering College of Engineering The Ohio State University Lecture 13

Road Map Lectures Administration Abstract machine characteristics Version control Software engineering Technical writing Lab 1 Forming Groups Requirements analysis Design Review Implementation Submission of documentation

System Software What is system software anyway? Answer: Software that supports the operation of the computer Often closely related to the architecture Allows developers to focus on the application without worrying about the low-level details of the machine

What and Why Examples Operating systems Device drivers Compilers, linkers/loaders, assemblers Motivation Software can often do a better job of managing the computer and optimizing performance People are expensive, computers are cheap

Layers of Abstraction Computer can be viewed at different levels of abstraction Each layer is a kind of virtual machine Each virtual machine corresponds to a language Bridges the human/computer gap Application Tools High-level Assembly ISA Microarchitecture Circuits

Computer Program Program: A collection of actions Written in a formal notation (language) Static (a piece of text, a file) Variations in language Imperative, functional, object-oriented, dynamically typed

Compiling Programs Program = Text file Contains easy-to-understand statements like "print", "if", "while", etc. But a computer can only execute machine instructions Instruction set architecture of the CPU A compiler translates the program (source code) into an executable (machine code) Recall "Bugs World" from CSE 2231 Examples: C, C++, Objective-C, Ada

Interpreting Programs An interpreter reads a program and executes it directly Advantages Platform independence Read-eval-print loop (aka REPL) Reflection Disadvantages Speed Later error detection (i.e., at run time) Examples: JavaScript, Python, Ruby

Combination of Both A language is not inherently compiled or interpreted A property of its implementation Sometimes a combination is used: Compile source code into an intermediate representation (byte code) Interpret the byte code Examples of combination: Java, C#

Java: Compile and Interpret program byte code MyProgram.java compiled MyProgram.class interpreted Java VM

Compile vs Interpret Compilation/interpretation is not fundamental to a language definition Can occur at all levels High-level or interpret compiler Assembly assembler Machine Language or interpret

Program vs Process Process: a program in execution Stateful (memory, registers) Current location of execution (PC) Variables have values (data section) Call stack Dynamic (changes over time) Instruction execution I/O interrupts (keyboard, touch, mouse, network, graphics ) Synchronization with other processes

Operating Systems How does a program become a process? Requires certain system resources (processor, memory, I/O, ) At any instant, there are many processes Multiple, concurrent users (stdlinux) Multiple, concurrent applications OS background tasks But there are a fixed set of resources Operating system handles resource management and process scheduling

Process Lifecycle

Challenges in Operating Systems Concurrency is fundamental Actors (processes/environment) are independent actors Concurrency is hard Nondeterminism Same inputs and initial conditions can result in different results Problems are hard to reproduce, debug Complex mental model: Impossible to think through all possible interleavings Synchronization is not familiar from sequential programming

Danger: Deadlock Example: Process A holds resource X, needs Y Process B holds resource Y, needs X Generally: a cycle in the resourceallocation graph

Danger: Starvation A process waits for a resource forever Example: Process A is waiting for resource X Two higher-priority processes alternate in using X, and A always loses out

Example A 2-way road squeezes down to one lane through a 4-mile tunnel Lane can not accommodate 2-way traffic No shoulder, pull-outs, turnarounds in tunnel Design a traffic protocol for the tunnel Cars at one end can not see the road at the other end of the tunnel Can use signs, clocks, traffic lights, flares, sextants, lunar calendar

Solutions?

Example: Dining Philosophers Set of philosophers, each of which is thinking, hungry, or eating Eating is finite, but may think forever Eating requires having forks, but forks are shared with neighbors Classically, 5 philosophers in a ring

Solutions?

Many More Examples Readers-writers Readers can share access to critical section, writers require exclusive access Bounded-buffer Producer putting things into buffer, consumer taking things out Producer has to wait if buffer is full, consumer has to wait if buffer is empty Sleeping barber, cigarette smokers, roller coaster, drinking philosophers

Responsibilities of OS Schedules processes Handles interrupts Manages real memory Manages virtual memory Large block of contiguous memory space Can be larger than physical memory File management File handles for open files, position marks Security Restrict what user-level process can do Prevent one user from interfering with another

Virtual Mem, Pages, Page Faults

Summary Compiling vs interpreting Program vs Process Operating systems: Challenges Operating systems: Responsibilities