Operating Systems Process description and control

Similar documents
Chap 4, 5: Process. Dongkun Shin, SKKU

Process Description and Control. Chapter 3

Process Description and Control. Chapter 3

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation

Major Requirements of an OS

Processes, PCB, Context Switch

OPERATING SYSTEMS: Lesson 4: Process Scheduling

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Process Description and Control

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

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

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

Processes and Non-Preemptive Scheduling. Otto J. Anshus

IT 540 Operating Systems ECE519 Advanced Operating Systems

Operating Systems. Lecture 05

Process Description and Control

OPERATING SYSTEM SUPPORT (Part 1)

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

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

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

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

Uniprocessor Scheduling

Why use an Operating System? Operating System Definition

Process Time. Steven M. Bellovin January 25,

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

Process Description and Control. Chapter 3

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

Process! Process Creation / Termination! Process Transitions in" the Two-State Process Model! A Two-State Process Model!

3.1 Introduction. Computers perform operations concurrently

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

Chapter 9. Uniprocessor Scheduling

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

Computer Systems II. First Two Major Computer System Evolution Steps

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

Processes and Threads

CPSC 341 OS & Networks. Processes. Dr. Yingwu Zhu

Process Management Rab Nawaz Jadoon

Process. Discussion session 3 1/30/2016

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

Process Description and Control. Major Requirements of an Operating System

Major Requirements of an Operating System Process Description and Control

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

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

Processes. Dr. Yingwu Zhu

Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)

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

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

Operating System Control Structures

Unit 3 : Process Management

Process Description and Control

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

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

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

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

Processes and Threads

Process a program in execution; process execution must progress in sequential fashion. Operating Systems

Introduction to Processes in Computer Systems SEEM

CSE325 Principles of Operating Systems. Processes. David P. Duggan February 1, 2011

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

CSC 539: Operating Systems Structure and Design. Spring 2006

Chapter 3: Processes

Operating System Support

CSCE Introduction to Computer Systems Spring 2019

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

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

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

Mon Sep 17, 2007 Lecture 3: Process Management

2 Processes. 2 Processes. 2 Processes. 2.1 The Process Model. 2.1 The Process Model PROCESSES OPERATING SYSTEMS

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch-3 Process Description and Control

PROCESS DESCRIPTION AND CONTROL

CSCE 313: Intro to Computer Systems

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

UNIT 2 PROCESSES 2.0 INTRODUCTION

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

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

Chapter 3: Processes. Operating System Concepts Essentials 2 nd Edition

Chapter 3 Process Description and Control

The fundamental task of any modern operating system is process management.

Process Description and Control

W4118 Operating Systems. Junfeng Yang

Scheduling Bits & Pieces

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

Process Scheduling Part 2

Part V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection

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

Processes. CS3026 Operating Systems Lecture 05

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

Chapter 9 Uniprocessor Scheduling

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru Department of Electronics and Communication Engineering

CHAPTER 2: PROCESS MANAGEMENT

UNIX Memory Management Interview Questions and Answers

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Scheduling of processes

SMD149 - Operating Systems

Chapter 3: Processes

Course: Operating Systems Instructor: M Umair. M Umair

PROCESSES Gursharan Singh Tatla 24/01/2011

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

Transcription:

Operating Systems Process description and control Mathieu Delalandre (PhD) François-Rabelais University, Tours city, France mathieu.delalandre@univ-tours.fr

Process description and control (1) Main memory A process(us) is an instance of a computer program that is being executed. It contains the program code and its current activity (i.e. data). Each process in an OS is managed from a PCB descriptor. PCB Process Control Block (i.e. Task Controlling Block or Task Structure) is a data structure in the operating system kernel containing the information needed to manage a particular process. Refer to PCB-A PCB-B Process table Kernel space Processus Table is an area of memory protected from normal user access, to manage the processes PCB, as they contain critical information for the process. Refer to Data Program Process A Working space Data Program Process B 2

Process description and control (2) Main memory List of frequent data appearing in a PCB Process identifier (pid) to refer the process at OS level Group data, hierarchy information (e.g. parent and child(s) of process), type of process and group membership(s) CPU-scheduling information (e.g. process priority, pointers to scheduling, etc.) Process state (e.g. ready, running, waiting, terminated, etc.) Program counter (PC) to refer current execution state of the process CPU registers correspond to current states of CPU s registers Security attributes, such as the process s owner and the processes' set of permissions (allowable operations). Accounting information (start time, end time, amount of CPU used, real time used, etc.) Etc. Memory management information includes page and segment tables on the executable code, call stack (to keep track of active subroutines and/or other events), etc. Operating system descriptors of resources that are allocated to the process, such as file descriptors and other data sources (e.g. devices) Etc. related to process management related to data management Refer to Refer to PCB-A PCB-B Data Program Data Program Process table Process A Process B Kernel space Working space 3

Process description and control (3) In some OS, when a process is created by another process, both are linked by some special relation (access to memory space, to special procedures, etc.). We re talking about process hierarchy and inheritance, like in Object-Oriented Programming (OOP). We distinguish: A A child process is a process created by another process (i.e. the parent process), this child process inherits most of parent s attributes (such as open files). B C A parent process is a process that has created one or more child processes. In some operating systems (e.g. Unix) every process (except the boot/root process) is created when another process executes a given system call. The process responsible of the call is the parent process and the newly-created process is the child process. Every process has one parent process, but can have many child processes. D E F Processus Inheritance 4

Process description and control (4) Multitasking (i.e. multiprogramming) is a method by which multiple tasks i.e. processes share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task can run at any time. Multitasking solves the problem by scheduling the tasks i.e. which task must run on the CPU, and which task must wait. CPU allocation P 1 P 2 P 3 t t 0 scheduling diagram of processes t The process P i is running 5

Process description and control (5) Scheduling refers to the way processes are assigned to run on the available CPUs. The aim of scheduling is to assign processes to be executed by the processor(s) over time, in a way that meets system objectives, such as response time, throughput and processor efficiency. In many systems, this scheduling activity is broken into three separate functions: long-, medium- and short-term scheduling. Scheduling affects the performance of the system because it determines which processes will wait and which will progress. Scheduling is a matter of managing s to minimize queuing delay and to optimize performance in a queuing environment. 1. job 2. long-term 5. dispatcher 3. ready CPU Main memory 4. short-term 6. blocked 7. mid-term 8. suspend (s) 6

Process description and control (6) 1. Job stores processes to enter in the system, they are put into the job. The job contains then the list of processes to create (e.g. name of class in OO programming). 2. Long term (admission ) decides which processes are to be admitted to the ready, they are then created and loaded in the main memory (e.g. object in OO programming). 3. Ready is a data structure to keep (i.e. manage) in the main memory the ready state processes for the CPU. 5. dispatcher CPU 4. short-term 4. Short-term (i.e. CPU ) decides which of the ready, in-memory processes, are to be executed (allocated a CPU) next following a clock interrupt, an I/O interrupt, an operating system call or another form of signal. 5. Dispatcher gives the control of the CPU to the process selected by the short-term. 1. job 2. long-term 3. ready Main memory 6. blocked 7. mid-term 8. suspend (s) 7

Process description and control (7) 6. Waiting/Blocked is a data structure to keep (i.e. manage) in the main memory the blocked state processes for the CPU. 7. Mid-term removes processes from main memory (if full) and places them on secondary memory (such as a disk drive) and vice versa. 8. Blocked suspend (s) contains list of processes move to disk (i.e. swapping). Two s are usually managed, related to the suspend process states suspended-blocked and suspended-ready. 5. dispatcher CPU 4. short-term 1. job 2. long-term 3. ready Main memory 6. blocked 7. mid-term 8. suspend (s) 8

Process description and control (8) Mid-term Long-term New Admitted Admitted Short-term Interrupt Long-term Exit Terminated completion Suspended ready Suspended blocked Activate Ready Suspend completion Suspend Activate Scheduler dispatch Waiting Running wait Disk memory Main memory As a process executes, it changes state. The state of a process is defined in part by the current activity of the process. New: process created, in this state, the process awaits admission to the ready state. This admission will be approved or delayed by a long-term, or admission,. Ready: a ready process has been loaded into main memory into the ready and is awaiting execution on a CPU (to be context switched into the CPU by the dispatcher following decision or the short-term ). Running: process is being executed by CPU. Terminated: a process may be terminated, either from the running state by completing its execution or by explicitly being killed. The process moves then to the terminated state. If a process is not removed from memory after entering this state, this state may also be called zombie. 9

Process description and control (9) Mid-term Long-term New Admitted Admitted Short-term Interrupt Long-term Exit Terminated completion Suspended ready Suspended blocked Activate Ready Suspend completion Suspend Activate Scheduler dispatch Waiting Running wait Disk memory Main memory As a process executes, it changes state. The state of a process is defined in part by the current activity of the process. Waiting/Blocked: a process that cannot execute until some events occurs, such as the completion of an I/O operation or a signal. Every blocked process is moved to the blocked. Suspended blocked: a process is put in disk memory by the mid-term (i.e. swapping out). Suspended ready: a process is ready to be load from disk to main memory (i.e. swapping in). 10

Process description and control (10) Queuing diagram for scheduling shows the s involved in the state transitions of processes. Rq. For simplicity, this diagram shows new processes going directly to the ready state without the option of either the ready state or either the ready/suspend state. long-term scheduling short-term scheduling job ready medium-term scheduling CPU medium-term scheduling Exit ready-suspend medium-term scheduling I/O or event wait completion blocked-suspend medium-term scheduling blocked 11

Process description and control (11) New Ready: the OS will move a process from the new state to the ready state (i.e. from the job to the ready ) when it is prepared to take an additional process. Most of the systems set some limits based on the number of existing processes in memory, they assure that there are not so many active processes as to degrade the performance. Ready Running: when it is time to select a process to run, the OS chooses one of the processes in the ready state. This is the job of the. Running Exit: the currently running process is terminated by the OS if the process indicates that it has completed, or if it aborts. Running Ready: the most common reasons for this transition are (1) in the case of preemptive scheduling, the OS assigns different levels of priority to different processes; thus a process A can preempt a process B and B will go to the Ready state and shifts to the ready. (2) the running process has reached the maximum allowable time for uninterrupted execution (all multiprogramming OS impose this type of time discipline) (3) a process may voluntarily release control of the processor (e.g. background process that performs some accounting or maintenance function periodically) 12

Process description and control (12) Running Blocked: a process is put in the Blocked state (and moves to the blocked ) if (1) it requests something (i.e. a resource) for which it must wait such as a file, a shared section, etc. that is not immediately available (e.g. a down operation on a Mutex) (2) it requests a service to the OS that is not prepared to perform immediately. A request to the OS is usually in the form of a system service call; that is; a call from the running program to a procedure that is part of the OS. Blocked Running: a process in the blocked state is moved to the ready state (and moves to the ready ) when the event for which it has been waiting occurs (e.g. up operation on a Mutex, system call return). Ready Exit: this transition is not shown on the state and queuing diagrams, in some systems, a parent may terminate a child process at any time. Also, if a parent terminates, all child processes associated wit that parent may terminate. Exit Ready: the comments under the preceding item apply. 13