Advanced Operating Systems CIS 720

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

CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
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,
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
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)
Advanced Operating Systems CIS 720 Lecture 1. Instructor Dr. Gurdip Singh – 234 Nichols Hall –
Implementing Processes and Process Management Brian Bershad.
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.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
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.
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.
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.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Lecture 3 Process.
Processes and threads.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Process concept.
Process Management Process Concept Why only the global variables?
Advanced Topics in Concurrency and Reactive Programming: Asynchronous Programming Majeed Kassis.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Operating Systems (CS 340 D)
Andy Wang COP 5611 Advanced Operating Systems
Processes and Threads Processes and their scheduling
OPERATING SYSTEMS CS3502 Fall 2017
Networks and Operating Systems: Exercise Session 2
Lecture Topics: 11/1 Processes Process Management
April 6, 2001 Gary Kimura Lecture #6 April 6, 2001
Chapter 2 Scheduling.
Intro to Processes CSSE 332 Operating Systems
Real-time Software Design
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
ICS 143 Principles of Operating Systems
Introduction What is an operating system bootstrap
Lecture 21: Introduction to Process Scheduling
Process & its States Lecture 5.
Mid Term review CSC345.
TDC 311 Process Scheduling.
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Description and Control
Processes Hank Levy 1.
Andy Wang COP 5611 Advanced Operating Systems
Processes and Process Management
Process Description and Control
Lecture 21: Introduction to Process Scheduling
CS510 Operating System Foundations
Chapter 2 Operating System Overview
Processes Hank Levy 1.
Chapter 3: Processes Process Concept Process Scheduling
CSE 153 Design of Operating Systems Winter 2019
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

Advanced Operating Systems CIS 720 Lecture 1

Instructor Dr. Gurdip Singh 234 Nichols Hall gurdip@ksu.edu

Course Web-site www.cis.ksu.edu/~singh/CIS720/F13/cis720.html

Overall Goals Concurrent programming Distributed Operating Systems 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: Brake Sensor: When it detects a brake action, it must actuate the brakes within 20ms. The execution time is 5ms. AC Button: It must start the AC within 4s after it detects the button press. The execution time is 500ms. 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( ); }} Cruise_Control( ) { init( ); while (…) { : activateCruise( ); }} AC_Control( ) { init( ); while (…) { : activateAC( ); }}

Concurrent Programs Advantages: Disadvantages: 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 :

Processes Process: a unit of work scheduled by OS, consisting of 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 program's data and stack (and the memory areas) program counter, stack pointer, and other CPU registers all other information necessary to run the program: process id, priority, accounting information, memory information, open files, process state, etc. executable code (and the memory area) stored in process control blocks (PCBs)

Process States New Running Terminated Ready Waiting 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 Running Terminated Ready Waiting

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

Example Task Period Deadline Run-Time Ti Di Ci --------------------------------------------------------------------- A 2 2 1 B 5 5 1 A B 2 4 5 10 15 (thanks to M. Neilsen)

Example Task Period Deadline Run-Time Ti Di Ci --------------------------------------------------------------------- A 2 2 1 B 5 5 2 A B 2 4 5 10 15

Process Scheduler Scheduling Criteria: 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!

Example Task Period Deadline Run-Time τi Ti Di Ci --------------------------------------------------------------------- A 2 2 1 B 5 5 2 (High Priority) (Low Priority) A B 2 4 5 10 15