Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.

Slides:



Advertisements
Similar presentations
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 3 – Process Concepts Outline 3.1 Introduction 3.1.1Definition of Process 3.2Process States:
Advertisements

6/9/2015B.Ramamurthy1 Process Description and Control B.Ramamurthy.
Process Description and Control
Processes CSCI 444/544 Operating Systems Fall 2008.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
3.5 Interprocess Communication
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.
CSSE Operating Systems
CSE451 Processes Spring 2001 Gary Kimura Lecture #4 April 2, 2001.
Processes April 5, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control. Process concepts n Definitions – replaces task, job – program in execution – entity that can be assigned to and executed.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Implementing Processes and Process Management Brian Bershad.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Chapter 3 Process Description and Control
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.
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,
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 2 Processes Processes Topics Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication.
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,
11/13/20151 Processes ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
Processes 2 Introduction to Operating Systems: Module 4.
Process Control Management Prepared by: Dhason Operating Systems.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Processes and threads.
Process concept.
Chapter 3: Process Concept
Operating Systems (CS 340 D)
Lecture Topics: 11/1 Processes Process Management
Chapter 3 – Process Concepts
Chapter 3: Process Concept
Chapter 3: Processes.
Intro to Processes CSSE 332 Operating Systems
Operating Systems (CS 340 D)
Chapter 3: Processes.
Process & its States Lecture 5.
Chapter 3: Processes.
Process Description and Control
Process Description and Control
Processes Hank Levy 1.
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Chapter 3: Processes.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Description and Control
Processes Hank Levy 1.
Chapter 3: Processes Process Concept Process Scheduling
Chapter 3: Process Management
Presentation transcript:

Chapter 2 Process Management

2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states and state transitions. process control blocks (PCBs)/process descriptors. how processors transition between processes via context switching. how interrupts enable hardware to communicate with software.

3 Introduction Computers perform operations concurrently For example, compiling a program, sending a file to a printer, rendering a Web page, playing music and receiving Processes enable systems to perform and track simultaneous activities Processes transition between process states Operating systems perform operations on processes such as creating, destroying, suspending, resuming and waking

4 Definition of Process A process is a program in execution. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. A process has its own address space consisting of: Text region Stores the code that the processor executes Data region Stores variables and dynamically allocated memory Stack region Stores instructions and local variables for active procedure calls

5 The operating system is responsible for the following activities in connection with process management. Process creation and deletion. process suspension and resumption. Provision of mechanisms for: process synchronization process communication

6 Process States: Life Cycle of a Process A process moves through a series of discrete process states: Running state The process is executing on a processor Ready state The process could execute on a processor if one were available Blocked state The process is waiting for some event to happen before it can proceed The OS maintains a ready list and a blocked list to store references to processes not running

7 Diagram of Process State Blocked

8 Process Management Operating systems provide fundamental services to processes including: Creating processes Destroying processes Suspending processes Resuming processes Changing a process’s priority Dispatching a process Blocking processes Waking up processes Interprocess communication (IPC)

9 State Transitions States Transitions The act of assigning a processor to the first process on the ready list is called dispatching The OS may use an interval timer to allow a process to run for a specific time interval or quantum Cooperative multitasking lets each process run to completion

10 State Transitions At this point, there are four possible state transitions When a process is dispatched, it transitions from ready to running When the quantum expires, it transitions from running to ready When a process blocks, it transitions from running to blocked When the event occurs, it transitions from blocked to ready

11 Process state transitions. Process States and State Transitions

12 How O.S manage process? Process Control Blocks (PCBs)/ Process Descriptors PCBs maintain information that the OS needs to manage the process Typically include information such as Process identification number (PID) Process state Program counter Scheduling priority A pointer to the process’s parent process Pointers to the process’s child processes Pointers to locate the process’s data and instructions in memory Pointers to allocated resources

13 Process Control Block

14 Process Control Blocks (PCBs)/ Process Descriptors Process table The OS maintains pointers to each process’s PCB in a process table Allows for quick access to PCBs When a process is terminated, the OS removes the process from the process table and frees all of the process’s resources

15 Process table and process control blocks. Process Control Blocks (PCBs)/ Process Descriptors

16 Process Operations A process may spawn a new process The creating process is called the parent process The created process is called the child process Exactly one parent process creates a child When a parent process is destroyed, operating systems typically respond in one of two ways: Destroy all child processes of that parent Allow child processes to proceed independently of their parents

17 Process creation hierarchy. Process Operations

18 Suspend and Resume Suspending a process Indefinitely removes it from contention for time on a processor without being destroyed A suspension may be initiated by the process being suspended or by another process A suspended process must be resumed by another process Two suspended states: suspendedready suspendedblocked

19 Process state transitions with suspend and resume. Suspend and Resume

20 Context Switching Context switches- Process of CPU Switch From Process to Process Performed by the OS to stop executing a running process and begin executing a previously ready process Save the execution context of the running process to its PCB Load the ready process’s execution context from its PCB Require the processor to not perform any “useful” computation OS must therefore minimize context- switching time

21 Context switch Process. Context Switching Process

22 CPU Switch From Process to Process

23 Process Scheduling Queues Job queue – set of all processes in the system. Ready queue – set of all processes residing in main memory, ready and waiting to execute. Device queues – set of processes waiting for an I/O device. Process migration between the various queues.

24 Review Questions How operating system manage processes? Explain the word PCB, Process Table, Context switching Describe about Process States or Process Life Cycle.