Process Management Rab Nawaz Jadoon

Similar documents
3.1 Introduction. Computers perform operations concurrently

Chap 4, 5: Process. Dongkun Shin, SKKU

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey

SMD149 - Operating Systems

Process Description and Control. Chapter 3

IT 540 Operating Systems ECE519 Advanced Operating Systems

Lecture Topics. Announcements. Today: Threads (Stallings, chapter , 4.6) Next: Concurrency (Stallings, chapter , 5.

Processes. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?

Process Description and Control

Operating Systems Process description and control

Why use an Operating System? Operating System Definition

Inter-Process Communication and Synchronization of Processes, Threads and Tasks: Lesson-1: PROCESS

Rab Nawaz Khan Jadoon

Processes. Sanzheng Qiao. December, Department of Computing and Software

Process Description and Control

Threads Assistant Professor DCS Operating System Concepts

OPERATING SYSTEMS: Lesson 4: Process Scheduling

Threads Chapter 5 1 Chapter 5

Processes. Dr. Yingwu Zhu

Processes. Processes and Process Management. What is a Process? What is a Process? What is a Process? Program Process

Major Requirements of an OS

Module 1. Introduction:

Computer Systems II. First Two Major Computer System Evolution Steps

Processes. OS Structure. OS Structure. Modes of Execution. Typical Functions of an OS Kernel. Non-Kernel OS. COMP755 Advanced Operating Systems

Chapter 3 Process Description and Control

Process Description and Control. Chapter 3

CPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - III Processes. Louisiana State University. Processes. September 1 st, 2009

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

Announcement. Exercise #2 will be out today. Due date is next Monday

Process Description and Control. Chapter 3

Processes and Threads

Dr. D. M. Akbar Hussain DE5 Department of Electronic Systems

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Introduction to Processes in Computer Systems SEEM

Processes in linux. What s s a process? process? A dynamically executing instance of a program. David Morgan. David Morgan

CS 31: Intro to Systems Processes. Kevin Webb Swarthmore College March 31, 2016

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

آنستیتیوت تکنالوجی معلوماتی و مخابراتی ICTI

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Process Description and Control. Major Requirements of an Operating System

Major Requirements of an Operating System Process Description and Control

Process Time. Steven M. Bellovin January 25,

Introduction to Operating System

Processes and More. CSCI 315 Operating Systems Design Department of Computer Science

! The Process Control Block (PCB) " is included in the context,

Chapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.)

3. Process Management in xv6

Process Description and Control

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

Inf2C - Computer Systems Lecture 16 Exceptions and Processor Management

1 PROCESSES PROCESS CONCEPT The Process Process State Process Control Block 5

Announcements Processes: Part II. Operating Systems. Autumn CS4023

Operating Systems. Computer Science & Information Technology (CS) Rank under AIR 100

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

Process Description and Control

Operating Systems. Lecture 3- Process Description and Control. Masood Niazi Torshiz

Processes. Process Scheduling, Process Synchronization, and Deadlock will be discussed further in Chapters 5, 6, and 7, respectively.

Deadlock. Rab Nawaz Jadoon DCS. Assistant Professor COMSATS Lahore Pakistan. Department of Computer Science

Chapter 3 Process Description and Control

Chapter 3: Processes. Operating System Concepts 8th Edition, modified by Stewart Weiss

Lecture 3: Processes. CMPUT 379, Section A1, Winter 2014 January 13, 15 and 17

Chapter 3: Processes

Course: Operating Systems Instructor: M Umair. M Umair

Operating System Control Structures

Threads Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Process. Discussion session 3 1/30/2016

Process Concept. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission

UNIX Processes. by Armin R. Mikler. 1: Introduction

Operating Systems. II. Processes

Operating Systems. Figure: Process States. 1 P a g e

Eastern Mediterranean University School of Computing and Technology Department of Information Technology. ITEC202 Operating Systems

518 Lecture Notes Week 3

Operating System Support

Operating System Structure

Introduction to Process in Computing Systems SEEM

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

Operating System Labs. Yuanbin Wu

CSCE Introduction to Computer Systems Spring 2019

Operating Systems. Review ENCE 360

Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions

CS 322 Operating Systems Practice Midterm Questions

Processes. CS3026 Operating Systems Lecture 05

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

Secondary Storage Management Rab Nawaz Jadoon

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

CSCE 313: Intro to Computer Systems

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

CSC 539: Operating Systems Structure and Design. Spring 2006

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

W4118 Operating Systems. Junfeng Yang

Class average is Undergraduates are performing better. Working with low-level microcontroller timers

Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2

Processes. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005

EECS 482 Introduction to Operating Systems

CSC 4320 Test 1 Spring 2017

Threads and Too Much Milk! CS439: Principles of Computer Systems January 31, 2018

Process Concepts 8/21/2014. CS341: Operating System. Scheduling: Theoretical Analysis

OPERATING SYSTEM. The Process. Introduction Process creation & termination Process state diagram Process scheduling & its criteria

Transcription:

Process Management Rab Nawaz Jadoon DCS COMSATS Institute of Information Technology Assistant Professor COMSATS Lahore Pakistan Operating System Concepts

Definitions The term process was used by the designer of MULTICS system in 1960. A program in execution. The animated spirit of a procedure. Entity to which processer is assigned. It is the dispatchable unit. Process 2

Process Each process has its own address space, which typically consists of, Text region Code of the program that CPU executes Data region It stores variables and dynamically allocated memory that the process uses during execution. Stack region It stores instructions and local variables for active procedure calls. 3

Process states, life cycle of a process Process states The OS must ensure that each process receives a sufficient amount of CPU time. During its life time a process moves through a series of discrete process states. Various events can cause a process to change state. There are three states particularly, New Ready Running Blocked terminated 4

Process states Awake Asleep 5

New Running Waiting Ready Process states The process is being created Instructions are being executed The process is waiting for some event to occur (I/O or reception of signal) The process is waiting to be assigned to a processor Terminate The process has finished execution 6

Running Process states A process is said to be running if it is executing on a processor. Ready A process is said to be ready if it could execute on a processor if one were available. Process waiting state before getting the CPU. Blocked A process is said to be in blocked state if it is waiting for some event to happen before it can proceed. E.g. I/O completion event. 7

Process State Transitions Changing states during execution of a process Following transitions are possible during the complete execution of a process, Dispatch Timerruout Block Wakeup 8

Dispatch State transitions The assignment of the CPU to the first process on the ready list is called dispatching. It is performed by a system entity called dispatcher. We indicate the transition as follows, Dispatch (process name): ready running 9

Timer runout Process states If a running process does not voluntarily leave the CPU before the time interval expires, the interrupting clock generates an interrupt, causing the operating system to regain control. The OS then makes the previously running process ready and makes the first process on the ready list running. Transition indicated as Timerrunout (process name): running ready and Dispatch (process name): ready running 10

Block Process states If a running process initiates an input/output operation before its quantum expires, the running process willingly leave the CPU and wait in the blocked state until the desired event get. Transition is, Block(process name): running blocked 11

Wakeup Process states When an input/output operation completes for which this process was in pending state. This state transition is initiated by the user process itself is block, the other three transitions are initiated by the operating system. The transition take place, Wakeup(process name): blocked ready 12

PCB (Process Control Block) The OS typically performs several operations when it creates a process. First it uniquely identifies each process by assigning a PID. Secondly, OS creates a PCB/PD (process descriptor), which maintains information that the OS needs to manage the process. PCB basically is data structure in the OS kernel which hold certain information about a process. 13

The information that PCB has, PID Process state Program counter Scheduling priority PCB (Process Control Block) Credentials (data that determines the resources this process can access) A pointer to the process s parent process Pointers to the process s child process. Pointers to locate the process s data and instruction in memory Pointers to allocate resources 14

PCB (Process Control Block) The PCB also stores the register contents, called the execution context, of the processor on which the process was last running, when it transitioned out of the running state. i.e. General purpose registers data. When a process transitions from one state to another, the OS must update information in the process s PCB. 15

Process Table and PCB Process Table The Process Table is a data structure maintained by the operating system to facilitate context switching and scheduling, and other activities. 16

Process operations OS must be able to perform certain process operations, including: Create a process Destroy a process Suspend a process Resume a process Change a proces priority Block a process Wake up a process Dispatch a process Enable a process to communicate with other processes (IPC) 17

Process Operations A process may spawn a new process. If it does The creating process is called parent process. The created process is called child process. Each child has exactly one parent but each parent may have more than one child. Process creation in UNIX and Linux are done through fork() or clone() system calls. System Call In computing, a system call is how a program requests a service from an operating system's kernel. 18

State model with suspend & Resume A process may be swapped out of working memory by the OS s memory manager in order to free up memory for another process. When a process is suspended, it essentially becomes dormant until resumed by the system. Because a process can be suspended while it is either ready or blocked, it may also exist in one of two further states, Ready suspended and Blocked suspended 19

These operations are important for several reasons, Reasons If a system is functioning poorly and may fail, then current processes may be suspended to be resumed after the problem is corrected. A user suspicious about the partial results of a process may suspend it until the user can ascertain whether or not the process is functioning correctly. In short term fluctuations in system load, some process may suspended and resume later when the load settles back to normal level. 20

State model with suspend & Resume Active states Suspended states 21

New transitions are, Five state model Suspend(process name): ready suspended Ready Resume (process name): suspended Ready Ready Suspend(process name): blocked suspendedblocked Resume(process name): suspendedblocked blocked. Completion(process name): suspendedblocked suspendedready 22

23