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

Similar documents
Process Description and Control

Process Description and Control. Chapter 3

Introduction to Processes in Computer Systems SEEM

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

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

PROCESS DESCRIPTION AND CONTROL

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

Processes, PCB, Context Switch

Process Description and Control. Chapter 3

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

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.

IT 540 Operating Systems ECE519 Advanced Operating Systems

Major Requirements of an OS

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

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

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

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

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)

Table 9.1 Types of Scheduling

UNIT 3. PROCESS MANAGEMENT

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

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

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Process Description and Control

Scheduling of processes

Unit 3 : Process Management

Process Description and Control

Chapter 9 Uniprocessor Scheduling

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

Chapter 3 Process Description and Control

Introduction to Process in Computing Systems SEEM

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

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

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

General Objectives: To understand the process management in operating system. Specific Objectives: At the end of the unit you should be able to:

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

Chapter 9. Uniprocessor Scheduling

Uniprocessor Scheduling. Chapter 9

Process Scheduling Part 2

Wednesday, September 14, Chapter 3: Processes

Operating Systems Process description and control

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College

Process. Discussion session 3 1/30/2016

Operating System Control Structures

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

SMD149 - Operating Systems

Chapter 3: Processes

Operating Systems Overview. Chapter 2

Frequently asked questions from the previous class survey

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

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

CSC 539: Operating Systems Structure and Design. Spring 2006

Process- Concept &Process Scheduling OPERATING SYSTEMS

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

UNIT 2 PROCESSES 2.0 INTRODUCTION

Chapter 8. Operating System Support. Yonsei University

Operating Systems Overview. Chapter 2

CS3733: Operating Systems

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

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CITS2230 Operating Systems Mid-semester test 2006

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

CPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31

CHAPTER 2: PROCESS MANAGEMENT

OPERATING SYSTEMS: Lesson 4: Process Scheduling

Chap 4, 5: Process. Dongkun Shin, SKKU

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

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

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

OPERATING SYSTEM SUPPORT (Part 1)

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

Processes and Non-Preemptive Scheduling. Otto J. Anshus

OPERATING SYSTEMS. P. PRAVEEN Asst.Prof, CSE

8: Scheduling. Scheduling. Mark Handley

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

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

Tasks. Task Implementation and management

Scheduling. The Basics

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

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

Chapter 3: Processes

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

A COMPARATIVE STUDY OF CPU SCHEDULING POLICIES IN OPERATING SYSTEMS

(MCQZ-CS604 Operating Systems)

Subject Teacher: Prof. Sheela Bankar

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

Last Class: Processes

Chapter 3: Process Concept

Chapter 3: Process Concept

CSCE 313: Intro to Computer Systems

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Course: Operating Systems Instructor: M Umair. M Umair

OPERATING SYSTEM : RBMCQ0402. Third RavishBegusarai.

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

Chapter 3: Process Concept

Introduction. CS3026 Operating Systems Lecture 01

Transcription:

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

Process The concept of process is fundamental to the structure of operating systems. Many definitions have been given for the term process, including: A program in execution. The animated spirit of a program. The entity that can be assigned to and executed on a processor. A program is a passive entity while process is a active entity 2

Process Many requirements that the operating system must meet can all be expressed with reference to process: 1. The operating system must interleave the execution of a number of processes to maximize processor use while providing reasonable response time. 2. The operating system must allocate resources to a process in conforming to a specific policy (e.g. certain functions or applications are of higher priority) while at the same time avoiding deadlocks. 3. The operating system may be required to support interprocess communication and user creation of processes, both of which may aid in the structuring of applications. 3

A Two-State Process Model Dispatch Enter Not Running Running Exit Pause (a) State transition diagram Enter Queue Dispatch Processor Exit Pause (b) Queuing diagram 4

The Creation and Termination of Processes Regardless of the model of process behavior used, the life of process is bounded by its creation and termination. Creation of Processes When a new process is to be added to those that are currently being managed by the OS, the OS Builds the data structures that are used to manage the process and Allocates the address space to be used by the process. These actions constitute the creation of a new process. 5

The Creation and Termination of Processes Reasons for Process Creation 1. A process is created in response to the submission of a job/task. 2. Interactive Log On initiates process(es) 3. OS creates process to Provide a Service on behalf of a user program 4. Spawned by Existing Processes for purposes of modularity or to exploit parallelism. The spawning process is called the parent process and the spawned process is called the child process. Related processes need to communicate and cooperate with each other. 6

The Creation and Termination of Processes Termination of Process A process should acknowledge OS about its completion for resource de-allocation A batch job should indicate a Halt instruction, which generates an interrupt to alert the operating system for process completion User actions can indicate when the process is completed in interactive applications Reasons of Process Termination 1. Normal Termination: The process executes an OS service call to indicate that it has completed running. 2. Time Limit Exceeded: The process has run longer than the specified total time limit. Types of process time measuring Total time elapsed Amount of time spent executing In user-interactive processes, the amount of time since the user provided input 7

The Creation and Termination of Processes 3. Required Memory Unavailable 4. Bounds Violation: The process tries to access memory locations that it is not allowed to access. 5. Protection Error: Process violates protection policies 6. Arithmetic Error: The process tries a prohibited computation 7. Time Overrun: The process has waited longer than specified time for an event to occur 8. An I/O Failure, such as: inability to find a file failure to read or write after specified number of tries invalid operation 8

The Creation and Termination of Processes 9. Invalid Instruction: The process attempts to execute a non-existent instruction 10. Privileged Instruction: The Process attempts to use an instruction reserved for the operating system. 11. Use of invalid data 12. User or the operating system has terminated the process 13. Parent Termination: When a parent terminates, the operating system may be designed to automatically terminate all the offspring of that parent. 14. Parent Request: A parent process typically has the authority to terminate any of its spawn. 9

Five-State Process Model The Not-Running state is further divided into: Ready State: Processes are ready for execution Blocked State: Processes waiting an I/O operation or some event to occur Dispatcher selects processes for execution form ready queue Increases efficiency of system New Enter Ready Dispatch Running Release Exit Time-out Event Occurs Blocked Event Wait 10

A Five-State Process Model The five states in this model are Running: The process is currently being executed. Ready: Processes that prepared to execute when given opportunity. Blocked: A process that cannot execute until some event occurs New: A newly created process that has not yet been admitted to the pool of executable processes by the OS Exit: A process that has been released from the execution cycle due because it is halted or aborted 11

Five State Process Model Admit Ready Queue Dispatch Processor Release Time-out Event Occur Block Queue Event-wait Queuing diagram for 5-state process model 12

Five State Process Model Ready Queue Dispatch Admit Processor Release Time-out Event 1 Occur Event 2 Occur Block Queue 1 Block Queue 2 Event 1 - wait Event 2 - wait Event n Occur Block Queue n Event n - wait Queuing diagram with multiple blocked queue 13

The Need for Swapping Suspended Processes The blocked state doesn t solve problem completely Memory holds multiple processes and the processor can move to another process when one process is waiting. While, processor is so much faster than I/O which is common for all processes residing in memory Thus even with multi-programming, a processor could be idle most of the time It will be better to perform swapping (virtual memory) among processes 14

Suspended State New Enter Ready Dispatch Running Release Exit Time-out Activate Suspend Blocked Event Occurs Event Wait Suspend Process state model with one suspend state 15

Suspended Processes Choices to bring a process into main memory: 1. admit a newly created process 2. bring in a previously suspended process. Previously suspended processes should have higher priority than newly created processes In other case, the load on system may increase Difficulty All the processes that have been suspended were in the Blocked state at the time of suspension Bring a suspended process back into main memory will decrease throughput (process might be still waiting) Process transits from blocked/suspended state to Ready state particular event occurs and is potentially available for execution. 16

Suspended Processes Therefore, there is need of an axillary state, as: Ready: The process is in main memory and available for execution. Blocked: The process is in main memory and awaiting an event. Blocked-Suspend: The process is in secondary memory and awaiting an event. Ready-Suspend: The process is in secondary memory but is available for execution as soon as it is loaded into main memory. 17

Seven State Process Model Enter New Enter Suspend Ready Suspend Event Occurs Blocked Suspend Activate Suspend Activate Suspend Ready Blocked Event Occurs Dispatch Time-out Event Wait Running Release Exit Process state model with two suspend states 18

Reasons of Suspension Swapping: OS need to release sufficient main memory to bring in a process that is ready to execute, Interactive user request Timing: Process may be executed periodically and may be suspended while waiting for the next time interval. Parent process request Other OS reason: The OS may suspend a background or utility process or a process that is suspected of causing a problem. 19

Process Scheduling Determines the processes to run when there are multiple run-able processes. Efficient resource utilization and increase in overall performance of the system Types of Scheduling The scheduling components (schedulers) are categorized w.r.t relative frequency of their usage: Long-term scheduler: Decides that whether or not to take on a new process and which one to take. Medium term scheduler: Responsible for swapping decision. Short-term scheduler or dispatcher: decides that which process should execute next. 20

Process Scheduling Long-term scheduler New Long-term scheduler Medium-term scheduler Ready Suspend Ready Short-term scheduler Running Release Exit Event Occurs Medium-term scheduler Event Occurs Event Wait Blocked Suspend Medium-term scheduler Blocked Scheduling and Process state transitions 21

Scheduling Criteria (1) User-Oriented, Performance-Related Criteria Response Time: Time between submission and first response of request. Technique should achieve low response time and maximize the number of interactive user processes receiving acceptable response time. Turnaround Time: Time interval (average time!) between the submission & completion of a process, i.e. actual execution time plus waiting time Deadlines: The scheduler should meet maximum percentage of deadline policies if defined. (2) User-Oriented, Other Criteria Predictability: The technique minimizes the waiting time regardless of the load to execute a processes in expected time. 22

Scheduling Criteria (3) System-Oriented, Performance-Related Criteria Throughput: Number of processes completed per unit time. Depends on the average length of a process, but is also influenced by the scheduling policy. Processor-Utilization: Time in percentage that the processor is busy. Technique should focus to increase this measure. (4) System-Oriented, Other Criteria Fairness: All processes should be treated similarly, if policy isn t provided or processes of same policy should be treated in same way Enforcing Priorities: Scheduling policy should favor higher-priority processes if priority is assigned/provided Balancing Resources: Processes which uses busy resources should be favored 23

Questions