Process Description and Control

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

Process Description and Control. Chapter 3

Process Description and Control. Major Requirements of an Operating System

Major Requirements of an Operating System Process Description and Control

Process Description and Control. Chapter 3

Process Description and Control

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

Major Requirements of an OS

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

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

Process Description and Control. Chapter 3

IT 540 Operating Systems ECE519 Advanced Operating Systems

Chapter 3 Process Description and Control

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

Operating System Control Structures

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

Process Description and Control

Introduction to Processes in Computer Systems SEEM

Process Description and Control

Wednesday, September 14, Chapter 3: Processes

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

Process. Discussion session 3 1/30/2016

Processes. CS3026 Operating Systems Lecture 05

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

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

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

Introduction to Process in Computing Systems SEEM

Processes, PCB, Context Switch

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

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

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

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

3.1 Introduction. Computers perform operations concurrently

CSCE Introduction to Computer Systems Spring 2019

Processes and Threads

Chap 4, 5: Process. Dongkun Shin, SKKU

Operating Systems : Overview

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering

Lecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors

Processes The Process Model. Chapter 2. Processes and Threads. Process Termination. Process Creation

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)

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

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

Operating Systems Process description and control

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

Today s class. Finish review of C Process description and control. Informationsteknologi. Tuesday, September 18, 2007

CSC 539: Operating Systems Structure and Design. Spring 2006

Processes The Process Model. Chapter 2 Processes and Threads. Process Termination. Process States (1) Process Hierarchies

OS Main Goals. 10/24/2013 Operating Systems, Beykent University 1

Chapter 3: Processes. Operating System Concepts 8 th Edition,

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

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

UNIT 3. PROCESS MANAGEMENT

PROCESS DESCRIPTION AND CONTROL

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

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Following are a few basic questions that cover the essentials of OS:

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

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

SMD149 - Operating Systems

Course: Operating Systems Instructor: M Umair. M Umair

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

Why use an Operating System? Operating System Definition

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

Learning Outcomes. Processes and Threads. Major Requirements of an Operating System. Processes and Threads

System Call. Preview. System Call. System Call. System Call 9/7/2018

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

Introduction. CS3026 Operating Systems Lecture 01

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

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

Processes and Threads

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

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

For use by students enrolled in #71251 CSE430 Fall 2012 at Arizona State University. Do not use if not enrolled.

Operating System. Chapter 3. Process. Lynn Choi School of Electrical Engineering

Mon Sep 17, 2007 Lecture 3: Process Management

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

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

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

Main Points of the Computer Organization and System Software Module

Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2

Chapter 3: Process-Concept. Operating System Concepts 8 th Edition,

Preview. The Thread Model Motivation of Threads Benefits of Threads Implementation of Thread

CSC 4320 Test 1 Spring 2017

Creating Threads COMP755

Chapter 3: Processes

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

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

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Chapter 3: Processes. Operating System Concepts 8th Edition,

Announcements Processes: Part II. Operating Systems. Autumn CS4023

Chapter 3 Process Description and Control

CSCE 313: Intro to Computer Systems

Operating Systems: Internals and Design Principles. Chapter 4 Threads Seventh Edition By William Stallings

Chapter 4: Threads. Operating System Concepts 9 th Edit9on

CS370 Operating Systems Midterm Review

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

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

CHAPTER 3 - PROCESS CONCEPT

Transcription:

Process Description and Control B.Ramamurthy 1/28/02 B.Ramamurthy 1

Introduction The fundamental task of any operating system is process management. OS must allocate resources to processes, enable sharing of information, protect resources, and enable synchronization among processes. In many modern OS the problems of process management is compounded by introduction of threads. We will process management in this lecture and threads in the next. 1/28/02 B.Ramamurthy 2

Topics for discussion Requirement of process Process states Creation, termination and suspension Five State Model Process Control Block (PCB) Process control Unix System V Summary 1/28/02 B.Ramamurthy 3

What is a process? A process is simply a program in execution: an instance of a program execution. Unit of work individually schedulable by an operating system. OS keeps track of all the active processes and allocates system resources to them according to policies devised to meet design performance objectives. To meet process requirements OS must maintain many data structures efficiently. The process abstraction is a fundamental OS means for management of concurrent program execution. Example: instances of process co-existing. 1/28/02 B.Ramamurthy 4

Major requirements OS must interleave the execution of a number of processes to maximize processor use while providing reasonable response time. OS must allocate resources to processes in conformance with a specific policy. Example: (i) higher priority, (ii) avoid deadlock. Support user creation of processes and IPC both of which may aid in the structuring of applications. 1/28/02 B.Ramamurthy 5

Process creation Four common events that lead to a process creation are: 1) When a new batch-job is presented for execution. 2) When an interactive user logs in. 3) When OS needs to perform an operation (usually IO) on behalf of a user process, concurrently with that process. 4) To exploit parallelism an user process can spawn a number of processes. ==> concept of parent and child processes. 1/28/02 B.Ramamurthy 6

Process Hierarchies Parent creates a child process, child processes can create its own process Forms a hierarchy UNIX calls this a "process group" Windows has no concept of process hierarchy all processes are created equal 1/28/02 B.Ramamurthy 7

Termination of a process Normal completion, time limit exceeded, memory unavailable Bounds violation, protection error, arithmetic error, invalid instruction IO failure, Operator intervention, parent termination, parent request A number of other conditions are possible. Segmentation fault : usually happens when you try write/read into/from a non-existent array/structure/object component. Or access a pointer to a dynamic data before creating it. (new etc.) Bus error: Related to function call and return. You have messed up the stack where the return address or parameters are stored. 1/28/02 B.Ramamurthy 8

A five-state process model Five states: New, Ready, Running, Blocked, Exit New : A process has been created but has not yet been admitted to the pool of executable processes. Ready : Processes that are prepared to run if given an opportunity. That is, they are not waiting on anything except the CPU availability. Running: The process that is currently being executed. (Assume single processor for simplicity.) Blocked : A process that cannot execute until a specified event such as an IO completion occurs. Exit: A process that has been released by OS either after normal termination or after abnormal termination (error). 1/28/02 B.Ramamurthy 9

State Transition Diagram Dispatch Release Admit NEW READY RUNNING Time-out EXIT Event Occurs Event Wait BLOCKED Think of the conditions under which state transitions may take place. 1/28/02 B.Ramamurthy 10

Queuing model Admit Ready queue Dispatch CPU Release Time-out Event1 Wait Event1 Occurs Event2 Wait Event2 Occurs Event n occurs Eventn Wait 1/28/02 B.Ramamurthy 11

Process Transitions Ready --> Running When it is time, the dispatcher selects a new process to run Running --> Ready the running process has expired his time slot the running process gets interrupted because a higher priority process is in the ready state 1/28/02 B.Ramamurthy 12

Process Transitions Running --> Blocked When a process requests something for which it must wait a service that the OS is not ready to perform an access to a resource not yet available initiates I/O and must wait for the result waiting for a process to provide input (IPC) Blocked --> Ready When the event for which it was waiting occurs 1/28/02 B.Ramamurthy 13

Implementation of Processes Skeleton of what lowest level of OS does when an interrupt occurs 1/28/02 B.Ramamurthy 14

Operating System Control Structures An OS maintains the following tables for managing processes and resources: Memory tables (see later) I/O tables (see later) File tables (see later) Process tables (this chapter) 1/28/02 B.Ramamurthy 15

Process description OS constructs and maintains tables of information about each entity that it is managing : memory tables, IO tables, file tables, process tables. Process control block: Associated with each process are a number of attributes used by OS for process control. This collection is known as PCB. For more details on PCB see Figure 2-4. 1/28/02 B.Ramamurthy 16

Process Table Entry (PCB) Fields of a process table entry 1/28/02 B.Ramamurthy 17

Process control block Contains three categories of information: 1) Process identification 2) Process state information 3) Process control information Process identification: numeric identifier for the process (pid) identifier of the parent (ppid) user identifier (uid) - id of the usr responsible for the process. Process state information: User visible registers Control and status registers : PC, IR, PSW, interrupt related bits, execution mode. Stack pointers 1/28/02 B.Ramamurthy 18

Process control block (contd.) Process control information: Scheduling and state information : Process state, priority, scheduling-related info., event awaited. Data structuring : pointers to other processes (PCBs): belong to the same queue, parent of process, child of process or some other relationship. Interprocess comm: Various flags, signals, messages may be maintained in PCBs. 1/28/02 B.Ramamurthy 19

Process control block (contd.) Process control information (contd.) Process privileges: access privileges to certain memory area, critical structures etc. Memory management: pointer to the various memory management data structures. Resource ownership : Pointer to resources such as opened files. Info may be used by scheduler. PCBs need to be protected from inadvertent destruction by any routine. So protection of PCBs is a critical issue in the design of an OS. 1/28/02 B.Ramamurthy 20

Queues as linked lists of PCBs 1/28/02 B.Ramamurthy 21

OS Functions related to Processes Process management: Process creation, termination, scheduling, dispatching, switching, synchronization, IPC support, management of PCBs Memory management: Allocation of address space to processes, swapping, page and segment management. IO management: Buffer management, allocation of IO channels and devices to processes. Support functions: Interrupt handling, accounting, monitoring. 1/28/02 B.Ramamurthy 22

Modes of execution Two modes : user mode and a privileged mode called the kernel mode. Why? It is necessary to protect the OS and key OS tables such as PCBs from interference by user programs. In the kernel mode, the software has complete control of the processor and all its hardware. When a user makes a system call or when an interrupt transfers control to a system routine, an instruction to change mode is executed. This mode change will result in an error unless permitted by OS. 1/28/02 B.Ramamurthy 23

Summary A process is a unit of work for the Operating System. Implementation of the process model deals with process description structures and process control methods. Process management is the of the operating system requiring a range of functionality from interrupt handling to IO management. Read Chapter 2: Material on Processes. 1/28/02 B.Ramamurthy 24