Advanced Operating Systems CIS 720 Lecture 1. Instructor Dr. Gurdip Singh – 234 Nichols Hall –

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Processes and Their Scheduling.
Threads Irfan Khan Myo Thein What Are Threads ? a light, fine, string like length of material made up of two or more fibers or strands of spun cotton,
Process Description and Control
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
3.5 Interprocess Communication
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
1/23/2008CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
CSE451 Processes Spring 2001 Gary Kimura Lecture #4 April 2, 2001.
Processes April 5, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Process Concept An operating system executes a variety of programs
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
Threads Many software packages are multi-threaded Web browser: one thread display images, another thread retrieves data from the network Word processor:
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Implementing Processes and Process Management Brian Bershad.
Lecture 2 Process Concepts, Performance Measures and Evaluation Techniques.
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Mid Term review CSC345.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
ITFN 3601 Introduction to Operating Systems Lecture 3 Processes, Threads & Scheduling Intro.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Distributed (Operating) Systems -Processes and Threads-
Processes & Threads Introduction to Operating Systems: Module 5.
1 OS Review Processes and Threads Chi Zhang
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Process Control Management Prepared by: Dhason Operating Systems.
Big Picture Lab 4 Operating Systems C Andras Moritz
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Lecture 3 Process.
Process concept.
Advanced Operating Systems CIS 720
Process Management Process Concept Why only the global variables?
Operating Systems (CS 340 D)
OPERATING SYSTEMS CS3502 Fall 2017
Lecture Topics: 11/1 Processes Process Management
Chapter 2 Scheduling.
Intro to Processes CSSE 332 Operating Systems
Operating Systems (CS 340 D)
Threads & multithreading
Process Virtualization. Process Process is a program that has initiated its execution. A program is a passive entity; whereas a process is an active entity.
Process management Information maintained by OS for process management
Introduction What is an operating system bootstrap
Lecture 21: Introduction to Process Scheduling
Process & its States Lecture 5.
Mid Term review CSC345.
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Description and Control
Processes Hank Levy 1.
Processes and Process Management
Process Description and Control
Lecture 21: Introduction to Process Scheduling
CS510 Operating System Foundations
Chapter 2 Operating System Overview
Process Management -Compiled for CSIT
Processes Hank Levy 1.
Chapter 3: Processes Process Concept Process Scheduling
Presentation transcript:

Advanced Operating Systems CIS 720 Lecture 1

Instructor Dr. Gurdip Singh – 234 Nichols Hall –

Course Web-site

Overall Goals Concurrent programming – Multi-threaded programming – Parallel Programming Distributed Operating Systems – Message passing systems – Replication and Fault Tolerance – Distributed shared memory – Concurrency control

Outline Concurrent programming introduction Structured design of concurrent programs – Design methodologies Synchronization primitives: – Semaphore, locks, monitors Correctness proofs Message passing programs Replication Distributed Shared Data Concurrency Control

Course evaluation Homeworks 10% Programming assignments 25-30% Midterm 25-30% Final 35-40%

Course tools and Pre-req Programming language: Java Recommended (not required) book: Foundations of Multi-threaded, Parallel and Distributed Programming, Gregory Andrews Undergraduate Operating Systems course Multi-threaded programming

Related Courses CIS625: Parallel Programming CIS725: Advanced Computer Networks CIS722: Operating Systems Practices CIS726: WWW Technologies CIS825: Topics in Distributed Computing

Sequential Program/Systems A system is sequential if no more than one control point can be serviced at a time. A program is sequential if no more than one control point can be enabled at a time.

Concurrent program/system A program is concurrent if multiple control points can be enabled at the same time. A system is concurrent if multiple control points can be serviced at the same time.

Why concurrent programming Exploiting parallelism in an application – Matrix multiplication – Finding a maximum in an array Better architecture Inherently concurrent applications Availability of concurrent platforms

Example system Consider a control system: 1.Brake Sensor: When it detects a brake action, it must actuate the brakes within 20ms. The execution time is 5ms. 2.AC Button: It must start the AC within 4s after it detects the button press. The execution time is 500ms. 3.Cruise Control button. It must activate the cruise control within 2s. The execution time is 100ms.

Control-Loop System main( ) { ….initialize…. while (1) { if (flagBrake) {activateBrakes( ); flagBrake = false;} if (flagAC) {activateAC( ); flagAC = false;} if (flagCruise) {activateCruise( ); flagCruise = false;} } Each interrupt handler simply sets the corresponding flag

Control-Loop System Pros: – It’s a simple sequential code – Debugging is easy; Developed systems are reliable. Cons: – It is difficult to satisfy real-time requirements. For example, what will happen if a brake action is detected while the control loop is executing ActivateCruise( ), which takes the maximum of 100ms ?

Event-Triggered System The system assigns a thread to each task For each sensor interrupt, the system dispatches the thread assigned to the corresponding task – Brake controller: create a thread that executes BrakeFunction( ) The thread priorities should be (1) the Brake control task (highest), (2) the Cruise control task, and (3) the AC control task (lowest) BrakeFunction( ) { init( ); while (…) { : activateBrake( ); : }} AC_Control( ) { init( ); while (…) { : activateAC( ); : }} Cruise_Control( ) { init( ); while (…) { : activateCruise( ); : }}

Concurrent Programs Advantages: – can increase CPU utilization – can provide fair service to many clients – can improve response time – allow programmers to focus only on sequential execution of each thread Disadvantages: – synchronization code is required to coordinate the execution of the multiple threads – Scheduling

Operating System Process/thread creation Program execution: Scheduling Access to I/O devices Memory management Accounting :

All the runnable software on a computer, including the OS, is organized into a number of sequential processes (or processes in short) Process: a unit of work scheduled by OS, consisting of 1.program's data and stack (and the memory areas) 2.program counter, stack pointer, and other CPU registers 3.all other information necessary to run the program: process id, priority, accounting information, memory information, open files, process state, etc. 4.executable code (and the memory area) Processes stored in process control blocks (PCBs)

Process States New – process is being created. Running – instructions are being executed. Waiting – blocked waiting for an external event to occur; e.g., message arrival. Ready – ready to run on a processor. Terminated – finished, awaiting garbage collection. New Ready Running Waiting Terminated

Multiprogramming In a multiprogramming system, the CPU switches from program to program, giving the users the illusion of parallelism (pseudo parallelism)

Implementing Processes When a context switch occurs between processes P0 and P1, the current state of running process P0 is saved in the PCB for P0, and the state of ready process P1 is restored from the PCB for P1.

Process Scheduling In a general operating system, a context switch occurs after each time quantum has expired; e.g., every 20 msec. Non-preemptive scheduling

TaskPeriodDeadlineRun-Time T i D i C i A B Example A B (thanks to M. Neilsen)

TaskPeriodDeadlineRun-Time T i D i C i A B Example A B

Process Scheduler The process scheduler determines which process to schedule (switch to) next. Types of schedulers: – preemptive – non-preemptive Scheduling Criteria: – CPU Utilization – Throughput - completions/time period – Turnaround time - total execution time – Waiting time - time spent in ready queue – Response time - time until first response – No missed deadlines - in a hard real-time system this is the most important criteria!

TaskPeriod DeadlineRun-Time τ i T i D i C i A B Example A B (High Priority) (Low Priority)