Processes and operating systems

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
Big Picture Lab 4 Operating Systems Csaba Andras Moritz.
Chapter 2: Processes Topics –Processes –Threads –Process Scheduling –Inter Process Communication (IPC) Reference: Operating Systems Design and Implementation.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zInterprocess communication. zOperating system performance.
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
Real Time Operating Systems Lecture 10 David Andrews
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System.
© 2000 Morgan Kaufman Overheads for Computers as Components Processes and operating systems Operating systems. 1.
CSC414 “Introduction to UNIX/ Linux” Lecture 2. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Low Overhead Real-Time Computing General Purpose OS’s can be highly unpredictable Linux response times seen in the 100’s of milliseconds Work around this.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Big Picture Lab 4 Operating Systems C Andras Moritz
 Operating system.  Functions and components of OS.  Types of OS.  Process and a program.  Real time operating system (RTOS).
Operating System Components) These components reflect the services made available by the O.S. Process Management Memory Management I/O Device Management.
Introduction to Operating Systems Concepts
Interprocess Communication Race Conditions
Kernel Design & Implementation
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter Objectives In this chapter, you will learn:
Operating Systems Review ENCE 360.
EC6703 EMBEDDED AND REAL TIME SYSTEMS
Process Management Process Concept Why only the global variables?
Topics Covered What is Real Time Operating System (RTOS)
Background on the need for Synchronization
Wayne Wolf Dept. of EE Princeton University
KERNEL ARCHITECTURE.
Applied Operating System Concepts
CGS 3763 Operating Systems Concepts Spring 2013
Threads and Data Sharing
Computer System Overview
HW & Systems: Operating Systems IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, October 22, 2013 Carolyn Seaman University of Maryland, Baltimore.
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Processes and operating systems
Ch4 Process and Operating System
Overheads for Computers as Components 2nd ed.
Process Description and Control
Lecture 2 Part 2 Process Synchronization
Process Description and Control
Concurrency: Mutual Exclusion and Process Synchronization
Process Description and Control
Process Description and Control
Processes and operating systems
Presented by: SHILPI AGARWAL
Process Description and Control
Process Description and Control
Overheads for Computers as Components 2nd ed.
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Processes and operating systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
- When you approach operating system concepts there might be several confusing terms that may look similar but in fact refer to different concepts:  multiprogramming, multiprocessing, multitasking,
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CSE 153 Design of Operating Systems Winter 19
Chapter 6: Synchronization Tools
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Wireless Embedded Systems
CSE 153 Design of Operating Systems Winter 2019
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Processes and operating systems Interprocess communication. Operating system performance. Power management. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Interprocess communication OS provides interprocess communication mechanisms: various efficiencies; communication power. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Interprocess communication Interprocess communication (IPC): OS provides mechanisms so that processes can pass data. Two types of semantics: blocking: sending process waits for response; non-blocking: sending process continues. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components 2nd ed. IPC styles Shared memory: processes have some memory in common; must cooperate to avoid destroying/missing messages. Message passing: processes send messages along a communication channel---no common address space. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components 2nd ed. Shared memory Shared memory on a bus: memory CPU 1 CPU 2 © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Race condition in shared memory Problem when two CPUs try to write the same location: CPU 1 reads flag and sees 0. CPU 2 reads flag and sees 0. CPU 1 sets flag to one and writes location. CPU 2 sets flag to one and overwrites location. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components 2nd ed. Atomic test-and-set Problem can be solved with an atomic test-and-set: single bus operation reads memory location, tests it, writes it. ARM test-and-set provided by SWP: ADR r0,SEMAPHORE LDR r1,#1 GETFLAG SWP r1,r1,[r0] BNZ GETFLAG © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components 2nd ed. Critical regions Critical region: section of code that cannot be interrupted by another process. Examples: writing shared memory; accessing I/O device. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components 2nd ed. Semaphores Semaphore: OS primitive for controlling access to critical regions. Protocol: Get access to semaphore with P(). Perform critical region operations. Release semaphore with V(). © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components Message passing Message passing on a network: CPU 1 CPU 2 message message message © 2008 Wayne Wolf Overheads for Computers as Components

Process data dependencies One process may not be able to start until another finishes. Data dependencies defined in a task graph. All processes in one task run at the same rate. P1 P2 P3 P4 © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components 2nd ed. Signals in UML More general than Unix signal---may carry arbitrary data: someClass <<signal>> aSig <<send>> sigbehavior() p : integer © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Evaluating RTOS performance Simplifying assumptions: Context switch costs no CPU time,. We know the exact execution time of processes. WCET/BCET don’t depend on context switches. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Scheduling and context switch overhead Process Execution time deadline P1 3 5 P2 10 With context switch overhead of 1, no feasible schedule. 2TP1 + TP2 = 2*(1+3)+(1_3)=11 © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Process execution time Process execution time is not constant. Extra CPU time can be good. Extra CPU time can also be bad: Next process runs earlier, causing new preemption. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components Processes and caches Processes can cause additional caching problems. Even if individual processes are well-behaved, processes may interfere with each other. Worst-case execution time with bad behavior is usually much worse than execution time with good cache behavior. © 2008 Wayne Wolf Overheads for Computers as Components

Effects of scheduling on the cache Schedule 1 (LRU cache): Process WCET Avg. CPU time P1 8 6 P2 4 3 P3 Schedule 2 (half of cache reserved for P1): © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Overheads for Computers as Components 2nd ed. Power optimization Power management: determining how system resources are scheduled/used to control power consumption. OS can manage for power just as it manages for time. OS reduces power by shutting down units. May have partial shutdown modes. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Power management and performance Power management and performance are often at odds. Entering power-down mode consumes energy, time. Leaving power-down mode consumes © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Simple power management policies Request-driven: power up once request is received. Adds delay to response. Predictive shutdown: try to predict how long you have before next request. May start up in advance of request in anticipation of a new request. If you predict wrong, you will incur additional delay while starting up. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Probabilistic shutdown Assume service requests are probabilistic. Optimize expected values: power consumption; response time. Simple probabilistic: shut down after time Ton, turn back on after waiting for Toff. © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

Advanced Configuration and Power Interface ACPI: open standard for power management services. applications device drivers OS kernel power management ACPI BIOS Hardware platform © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.

ACPI global power states G3: mechanical off G2: soft off S1: low wake-up latency with no loss of context S2: low latency with loss of CPU/cache state S3: low latency with loss of all state except memory S4: lowest-power state with all devices off G1: sleeping state G0: working state © 2008 Wayne Wolf Overheads for Computers as Components 2nd ed.