Operating Systems Processes (Ch 2.1).

Slides:



Advertisements
Similar presentations
Operating Systems COMP 4850/CISG 5550 Processes Introduction to Threads Dr. James Money.
Advertisements

CSE 451: Operating Systems Winter 2007 Module 4 Processes Ed Lazowska Allen Center 570.
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
Operating System I Processes. F “A program in execution” F Modern computers allow several at once –“pseudoparallelism” A B C Program Counter A B C B A.
CSE 451: Operating Systems Winter 2006 Module 4 Processes Ed Lazowska Allen Center 570.
1 Processes Professor Jennifer Rexford
Processes CSCI 444/544 Operating Systems Fall 2008.
Operating Systems Processes (Ch 4.1). Processes “A program in execution” Modern computers allow several at once –“pseudoparallelism” A B C Program Counter.
Operating Systems Processes (Ch 3.1). Processes “A program in execution” Modern computers allow several at once –“pseudoparallelism” A B C Program Counter.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Operating Systems Processes (Ch 4.1). Processes “A program in execution” Modern computers allow several at once –“pseudoparallelism” A B C Program Counter.
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
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)
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Processes in Unix, Linux, and Windows CS-502 Fall Processes in Unix, Linux, and Windows CS502 Operating Systems (Slides include materials from Operating.
Review. Questions F What are two functions of an OS? F What “layer” is above the OS? F What “layer” is below the OS?
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Implementing Processes and Process Management Brian Bershad.
Multiprogramming CSE451 Andrew Whitaker. Overview Multiprogramming: Running multiple programs “at the same time”  Requires multiplexing (sharing) the.
Chapter 4 Processes. Process: what is it? A program in execution A program in execution usually usually Can also have suspended or waiting processes Can.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
8-Sep Operating Systems Yasir Kiani. 8-Sep Agenda for Today Review of previous lecture Process scheduling concepts Process creation and termination.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Processes Dr. Yingwu Zhu. Process Concept Process – a program in execution – What is not a process? -- program on a disk - a process is an active object,
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.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Processes and threads.
Chapter 3: Process Concept
Operating Systems Processes ENCE 360.
Lecture Topics: 11/1 Processes Process Management
Process Management Presented By Aditya Gupta Assistant Professor
Operating Systems: A Modern Perspective, Chapter 6
Chapter 3: Processes.
Intro to Processes CSSE 332 Operating Systems
IT 344: Operating Systems Module 4 Processes
Chapter 3: Processes.
Processes in Unix, Linux, and Windows
More examples How many processes does this piece of code create?
Operating Systems Lecture 6.
Process & its States Lecture 5.
Mid Term review CSC345.
Chapter 3: Processes.
Operating Systems Processes (Ch 4.1).
Processes Hank Levy 1.
Processes and Process Management
Lecture 6: Multiprogramming and Context Switching
Chapter 3: Processes.
October 7, 2002 Gary Kimura Lecture #4 October 7, 2002
CSE 451: Operating Systems Winter 2003 Lecture 4 Processes
CSE 451: Operating Systems Autumn 2009 Module 4 Processes
IT 344: Operating Systems Winter 2008 Module 4 Processes
Implementing Processes, Threads, and Resources
CSE 451: Operating Systems Winter 2007 Module 4 Processes
Processes in Unix and Windows
CS510 Operating System Foundations
CSE 451: Operating Systems Autumn 2004 Module 4 Processes
Outline Process Management Process manager Hardware process
Processes Hank Levy 1.
Implementing Processes, Threads, and Resources
Presentation transcript:

Operating Systems Processes (Ch 2.1)

Processes “A program in execution” Modern computers allow several at once “pseudoparallelism” A A B C A Program Counter B B Conceptual View C C Time

Processes “A program in execution” main() { ... } A() { … main() { ... } A() { … Heap Stack A main “more” than a program: ls, tcsh “less” than a program: gcc blah.c (cpp, cc1, cc2, ln …) “A sequential stream of execution in it’s own address space”

Process States Consider: (Hey, you, show states in top!) cat /etc/passwd | grep claypool Exit New Running Dispatch I/O Wait Interrupt Ready Waiting I/O Complete (Hey, you, show states in top!)

Design Technique: State Machines Process states Move from state to state based on events Reactive system Can be mechanically converted into a program Other example: string parsing, pre-processor

Unix Process Creation System call: fork() System call: exec() Shell creates (nearly) identical copy of process return value different for child/parent System call: exec() over-write with new process address space Shell uses fork() and exec() simple! (Hey, you, show demos!)

Process Scheduler ... cat ls disk vid Scheduler All services are processes Small scheduler handles interrupts, stopping and starting processes

Process Control Block Each process has a PCB state program counter registers memory management … OS keeps a table of PCB’s, one per process (Hey! Simple Operating System, “system.h”)

Interrupt Handling Stores program counter (hardware) Loads new program counter (hardware) jump to interrupt service procedure Save PCB information (assembly) Set up new stack (assembly) Set “waiting” process to “ready” (C) Scheduler (C) Newly awakened process Often called a context-switch Previously running process

Context Switch Pure overhead So … fast, fast, fast typically 1 to 1000 microseconds Sometimes special hardware to speed up Real-Time wants worse case RT Linux worse case sub 20 microseconds How to decide when to switch contexts to another process is process scheduling

Linux Context Switch Times Measured with LMBench (http://math.nmu.edu/~benchmark/)

Processes in Linux PCB is in struct task_struct states: RUNNING, INTERRUPTIBLE, UNINTERRUPTIBLE priority: when it runs counter: how long it runs Environment inherited from parent NR_TASKS max, 2048 1/2 is max per user

Processes in NT/2000 States: ready, standby (first in line), running, waiting, transition, terminated priority - when it runs Processes are composed of threads (revisit threads after scheduling)