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.

Slides:



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

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.
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.
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
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.
CSE451 Processes Spring 2001 Gary Kimura Lecture #4 April 2, 2001.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
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
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?
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
CE Operating Systems Lecture 5 Processes. Overview of lecture In this lecture we will be looking at What is a process? Structure of a process Process.
COSC 3407: Operating Systems Lecture 3: Processes.
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.
Exec Function calls Used to begin a processes execution. Accomplished by overwriting process imaged of caller with that of called. Several flavors, use.
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.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Processes: program + execution state
REVIEW OF COMMONLY USED DATA STRUCTURES IN OS. NEEDS FOR EFFICIENT DATA STRUCTURE Storage complexity & Computation complexity matter Consider the problem.
Mid Term review CSC345.
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  Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Computer Studies (AL) Operating System Process Management - Process.
Processes – Part I Processes – Part I. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Review on OSs Upon brief introduction of OSs,
Processes Questions answered in this lecture: What is a process? How does the dispatcher context-switch between processes? How does the OS create a new.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
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.
Direct memory access. IO Command includes: buffer address buffer length read or write dada position in disk When IO complete, DMA sends an interrupt request.
Processes and threads.
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
Operating Systems Processes ENCE 360.
Lecture Topics: 11/1 Processes Process Management
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Process Concept
Chapter 3: Processes.
Chapter 3: Processes.
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.
CSE 451: Operating Systems Winter 2003 Lecture 4 Processes
Processes in Unix and Windows
CS510 Operating System Foundations
CSE 451: Operating Systems Autumn 2004 Module 4 Processes
Processes Hank Levy 1.
Operating Systems Processes (Ch 2.1).
Presentation transcript:

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 CConceptual View Time

Processes F “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 F 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 F Process states F Move from state to state based on events –Reactive system F Can be mechanically converted into a program F 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 F (Hey, you, show demos!)

Java Process Creation  “fork” and “exec” rolled into exec() public Process exec(String command) –args separated by whitespace F Child Process output:status: –getOutputStream()- waitFor() –getInputStream()- exitValue() –getErrorStream()- destroy() F Depends upon underlying OS proc support!

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

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

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

Interrupt Handling F Stores program counter F Loads new program counter –jump to interrupt service procedure F Save PCB information F Set up new stack F Set “waiting” process to “ready” F Re-schedule (probably awakened process) F If new process, called a context-switch

Context Switch F Pure overhead F Fast, fast, fast –typically 1 to 1000 microseconds F Sometimes special hardware to speed