CSE 451: Operating Systems Winter 2009 Module 4 Processes Mark Zbikowski Gary Kimura.

Slides:



Advertisements
Similar presentations
CSE 451: Operating Systems Winter 2007 Module 4 Processes Ed Lazowska Allen Center 570.
Advertisements

IT344 – Operating Systems Winter 2011, Dale Rowe.
CSE 451: Operating Systems Winter 2006 Module 4 Processes Ed Lazowska Allen Center 570.
Processes CSCI 444/544 Operating Systems Fall 2008.
Chapter 4: Threads. 2 What’s in a process? A process consists of (at least): –an address space –the code for the running program –the data for the running.
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.
Chapter 3 Processes 1.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
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.
Chapter 6 Implementing Processes, Threads, and Resources.
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.
CSE 451: Operating Systems Spring 2012 Module 4 Processes Ed Lazowska Allen Center 570.
Lecture Topics: 11/3 Address spaces Memory protection Creating a process –NT style –Unix style.
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
CSE 451: Operating Systems Winter 2012 Processes Mark Zbikowski Gary Kimura.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Process in Unix, Linux, and Windows CS-3013 A-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Introduction to Processes CS Intoduction to Operating Systems.
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.
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,
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.
2 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager.
Lecture 5 Page 1 CS 111 Online Process Creation Processes get created (and destroyed) all the time in a typical computer Some by explicit user command.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Processes and threads.
CSE 451: Operating Systems Winter 2011 Threads
Lecture Topics: 11/1 Processes Process Management
Linux Processes & Threads
CSE 451: Operating Systems Autumn 2013 Module 4 Processes
Operating Systems: A Modern Perspective, Chapter 6
IT 344: Operating Systems Module 4 Processes
Chapter 4: Threads.
CSE 451: Operating Systems Winter 2010 Module 5 Threads
Processes in Unix, Linux, and Windows
Processes in Unix, Linux, and Windows
System Structure and Process Model
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Mid Term review CSC345.
CSE 451: Operating Systems Winter 2011 Processes
CSE 451: Operating Systems Winter 2010 Module 4 Processes
Lecture Topics: 11/1 General Operating System Concepts Processes
Processes Hank Levy 1.
Processes and Process Management
CSE 451: Operating Systems Winter 2009 Module 5 Threads
Chapter 3: Processes.
October 7, 2002 Gary Kimura Lecture #4 October 7, 2002
CSE 451: Operating Systems Winter 2012 Threads
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
CSE 451: Operating Systems Spring 2006 Module 4 Processes
Outline Process Management Process manager Hardware process
CSE 153 Design of Operating Systems Winter 2019
Processes Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 4 Processes
Presentation transcript:

CSE 451: Operating Systems Winter 2009 Module 4 Processes Mark Zbikowski Gary Kimura

9 April Process management This module begins a series of topics on processes, threads, and synchronization –this is the most important part of the class Today: processes and process management –what are the OS units of ownership / execution? –how are they represented inside the OS? –how is the CPU scheduled across processes? –what are the possible execution states of a process? and how does the system move between them?

9 April The process The process is the OS’s abstraction for execution –the unit of ownership –the unit of execution (sorta) –the unit of scheduling (kinda) –the dynamic (active) execution context compared with program: static, just a bunch of bytes Process is often called a job, task, or sequential process –a sequential process is a program in execution defines the instruction-at-a-time execution of a program

9 April What’s in a process? A process consists of (at least): –an address space –the code for the running program –the data for the running program –at least one thread Registers, IP Floating point state Stack and stack pointer –a set of OS resources open files, network connections, sound channels, … In other words, it’s all the stuff you need to run the program –or to re-start it, if it’s interrupted at some point

9 April There’s a data structure called the process object (_ KPROCESS in base\ntos\inc\ke.h) that holds all this stuff –Processes are identified from user space by a process ID, returned by NtCreateProcess. OS keeps all of a process’s hardware execution state in the _KTHREAD (same file) when the process isn’t running –IP, SP, registers, etc. –when a process is unscheduled, the state is transferred out of the hardware into the _KTHREAD Note: It’s natural to think that there must be some esoteric techniques being used –fancy data structures that’d you’d never think of yourself Wrong! It’s pretty much just what you’d think of! Except for some clever assembly code… The Process Object

9 April A process’s address space (very simplified) 0x x7FFFFFFF address space code (text segment) static data (data segment) heap (dynamic allocated mem) stack (dynamic allocated mem) IP SP

9 April Process creation New processes are created by existing processes –creator is called the parent –created process is called the child –what creates the first process, and when? In some systems, parent defines or donates resources and privileges for its children –LINUX/UNIX: child inherits parent’s security context, environment, open file list, etc. –NT: all the above are optional (remember, mechanism vs policy), the Windows subsystem provides policy. When child is created, parent may either wait for it to finish, or may continue in parallel, or both!

9 April Process Creation 2 In LINUX, fork/exec pairs. –fork() clones the current process, duplicates all memory, “inherit” open files –exec() throws away all memory and loads new program into memory. Keeps all open files! –Very useful, but… wasteful. >99% of all fork() calls followed by exec(). Copy-on-write memory helps but still a big overhead. Windows has parent process doing the work –Create process –Fill in memory –Pass handles –Create thread with stack and IP –Many system calls (compared with LINUX) but all policy is in user code. More flexible.

9 April Process Destruction Privileged operation! –Process can always kill itself –Killing another process requires permission Terminates all threads (next lecture) Releases owned resources to known state –Files –Events –Memory Notification sent to interested parties KPROCESS is freed