Operating Systems Processes (Ch 4.1). Processes “A program in execution” Modern computers allow several at once –“pseudoparallelism” A B C Program Counter.

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.
IT344 – Operating Systems Winter 2011, Dale Rowe.
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.
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.
CSE451 Processes Spring 2001 Gary Kimura Lecture #4 April 2, 2001.
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
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?
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
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,
OS, , Part II Processes Department of Computer Engineering, PSUWannarat Suntiamorntut.
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  Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Processes – Part I Processes – Part I. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Review on OSs Upon brief introduction of OSs,
Linux Processes Travis Willey Jeff Mihalik. What is a process? A process is a program in execution A process includes: –program counter –stack –data section.
Silberschatz, Galvin and Gagne  Operating System Concepts Process Concept An operating system executes a variety of programs:  Batch system.
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 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Processes and threads.
Process Management Process Concept Why only the global variables?
Operating Systems Processes ENCE 360.
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
Processes in Unix, Linux, and Windows
More examples How many processes does this piece of code create?
Processes in Unix, Linux, and Windows
Operating Systems Lecture 6.
Process & its States Lecture 5.
Mid Term review CSC345.
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
Processes in Unix, Linux, and Windows
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
Operating Systems Processes (Ch 2.1).
Presentation transcript:

Operating Systems Processes (Ch 4.1)

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

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

Process States Consider: cat /etc/passwd | grep claypool WaitingRunningReady New Dispatch Interrupt I/O Wait I/O Complete Exit (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() –creates (nearly) identical copy of process –return value different for child/parent System call: exec() –over-write with new process memory Shell –uses fork() and exec() –simple! (Hey, you, show demos!)

Process Scheduler catls... disk Scheduler vid 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 ”)

Question Usually the PCB is in OS memory only. Assume we put the PCB into a processes address space. What problems might this cause?

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) Re-schedule (probably awakened process) (C) If new process, called a context-switch

Context Switch Pure overhead So … fast, fast, fast –typically 1 to 1000 microseconds Sometimes special hardware to speed up How to decide when to switch contexts to another process is process scheduling

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 States: ready, standby (first in line), running, waiting, transition, terminated priority - when it runs Processes are composed of threads –(revisit threads after scheduling)

True or False Unix is a “simple structure” OS Micro Kernels are faster than other OS structures Virtual Machines are faster than other OS structures