This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 1 CSE 421/521 - Operating Systems Fall 2011 Tevfik Ko ş ar University at Buffalo September 6 th , 2011 Lecture - III Processes 2 Roadmap • Processes – Basic Concepts – Process Creation – Process Termination – Context Switching – Process Queues – Process Scheduling – Interprocess Communication 3 Process Concept • a Process is a program in execution ; Typical process image implementation Stal ings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). ! A process image consists of three components 1. an executable program 2. the associated data needed by the program 3. the execution context of the process, which contains all information the O/S needs to manage the process (ID, state, CPU registers, stack, etc.) user address space Process Control Block 4 ! The Process Control Block (PCB) Typical process image implementation " is included in the context, along with the stack " is a “snapshot” that contains all necessary and sufficient data to restart a process where it left off (ID, state, CPU registers, etc.) " is one entry in the operating system’s process table (array or linked list) PCB 1 PCB 2 PCB 3 . . . context user address space program code data stack process control block (PCB) Process Control Block 5 Illustrative contents of a process image in (virtual) memory ! Example of process and PCB location in memory O/S process 2 process 1 context program code data program code data stack process control block (PCB) identification program code data stack CPU state info control info stack • numeric identifier • parent identifier • user identifier • etc. • user-visible registers • control & status registers • program counter • stack pointers, etc. • schedulg & state info • links to other proc’s • memory limits • open files • etc. 6 Process State • As a process executes, it changes state – new : The process is being created – ready : The process is waiting to be assigned to a processor – running : Instructions are being executed – waiting : The process is waiting for some event to occur – terminated : The process has finished execution Process Creation 7 ! Some events that lead to process creation (enter) ! Some events that lead to process creation (enter) " the system boots # when a system is initialized, several background processes or “daemons” are started (email, logon, etc.) " a user requests to run an application # by typing a command in the CLI shell or double-clicking in the GUI shell, the user can launch a new process " an existing process spawns a child process # for example, a server process (print, file) may create a new process for each request it handles # the init daemon waits for user login and spawns a shell " a batch system takes on the next job in line all cases of process spawning Process Creation 8 !...
View Full Document
This document was uploaded on 10/01/2011.
- Fall '09
- Operating Systems