Computer Studies (AL) Operating System Process Management - Process.

Slides:



Advertisements
Similar presentations
3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
Advertisements

Processes Management.
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives Understand Process concept Process scheduling Creating.
Chapter 3: Processes.
Processes CSCI 444/544 Operating Systems Fall 2008.
1/27/2010CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying an earlier version.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
CMPT 300: Operating Systems I Ch 3: Processes Dr. Mohamed Hefeeda
CSSE Operating Systems
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Process Concept An operating system executes a variety of programs
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
1/26/2007CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
Phones OFF Please Processes Parminder Singh Kang Home:
CE Operating Systems Lecture 5 Processes. Overview of lecture In this lecture we will be looking at What is a process? Structure of a process Process.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Inter-process Communication Communication in Client-Server.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Process Concept Process – a program.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
Processes: program + execution state
Chapter 3 Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Jan 19, 2005 Chapter 3: Processes Process Concept.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 2-1: Process Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Outline n Process Concept n Process.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
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.
CS212: OPERATING SYSTEM Lecture 2: Process 1. 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: Processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
3.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Overview: Process Concept Process Scheduling Operations on Processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
1  process  process creation/termination  context  process control block (PCB)  context switch  5-state process model  process scheduling short/medium/long.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
Lecture 4: Processes & Threads. Lecture 4 / Page 2AE4B33OSS Silberschatz, Galvin and Gagne ©2005 Contents The concept of Process Process states and life-cycle.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Types of shedulars Process.
Chapter three.  An operating system executes a variety of programs:  A batch system executes jobs.  A time-shared systems has user programs or tasks.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 8 Processes II Read Ch.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Operating System Components) These components reflect the services made available by the O.S. Process Management Memory Management I/O Device Management.
Lecture 3 Process.
Chapter 3: Processes.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Topic 3 (Textbook - Chapter 3) Processes
Operating Systems (CS 340 D)
Sujata Ray Dey Maheshtala College Computer Science Department
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Process Concept
Chapter 3: Processes.
Operating Systems (CS 340 D)
Chapter 3: Processes.
CGS 3763 Operating Systems Concepts Spring 2013
Lecture 2: Processes Part 1
Process & its States Lecture 5.
Chapter 3: Processes.
Sujata Ray Dey Maheshtala College Computer Science Department
Chapter 3: Processes.
Outline Chapter 2 (cont) Chapter 3: Processes Virtual machines
Chapter 3: Processes Process Concept Process Scheduling
Chapter 3: Process Concept
Presentation transcript:

Computer Studies (AL) Operating System Process Management - Process

Reference Silberschatz, Galvin, Gagne, “Operating System Concepts 6th Edition”, 2003, Wiley William Stallings, “Operating Systems Internals and Design Principles”, 2001, Prentice Hall

Content Process Concept Process Scheduling Operations on Process Cooperating Processes

Process Concept A process is a program in execution A process is more than the program code Code: text section Value of program counter Process stack (temporary data) Data section (global variables)

Process state As a process executes, it changes state New: The process is begin created Running: Instructions are being executed Waiting: The process is waiting for some event to occur (such as an I/O completion or reception of a signal) Ready: The process is waiting to be assigned to a processor Terminated: The process has finished execution

new waiting readyrunning terminated admitted interrupt Scheduler dispatch I/O or event completion I/O or event wait Exit

Process Control Block Each process is represented in the operating control block (PCB), also called task control block Process state Program counter CPU registers CPU-scheduling information Memory-management information Accounting information I/O status inormation

Process scheduling The objective of multiprogramming is to have some process running at all times, so as to maximize CPU utilization There are several scheduling queues in the system Ready queue: processes that are residing in main memory and are ready and waiting to execute Device queue: List of processes waiting to I/O device

Queueing diagram A new process is initially put in the ready queue. It waits in the ready queue until it is selected for execution (or dispatched) Once the process is assigned to the CPU and is executing, one of several events could occur: The process could issue and I/O request, and then be placed in an I/O queue The process could create a new subprocess and wait for its termination The process could be removed forcibly from the CPU and be put back in the ready queue.

Schedulers The Operating System must select, for scheduling purposes, processes from the queues in some fashion The selection process is carried out by the appropriate scheduler

In batch system (different schedulers) The processes are usually spooled to a mass-storage device for later execution There are two scheduler: Long-term scheduler (job scheduler) Selects processes from this pool and loads them into memory for execution Short-term scheduler (CPU scheduler) Selects from among processes that are read to execute, and allocates the CPU to one of them.

Cont’ The long-term scheduler may control the degree of multiprogramming. (no. of process in memory) There are two kinds of process: I/O bound: spend more time on doing I/O than computations CPU bound: spend more time on doing computations. The long-term scheduler should select a good process mix between these processes. (better performance)

In time-sharing system The long-term scheduler may be absent or minimal. Unix: no long-term scheduler (only short- term)

Context Switch Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as a context switch. The context is represented in PCB. Value of CPU registers Process state Memory-management information

When context switch occurs The kernel saves the context of the old process in its PCB and loads the saved context of the new process scheduled to run. Context switch time is pure overhead, because the system does no useful work while switching.

The procedure of context switching form Process A to B involves : Blocking of Process A due to request of I/O resource, time quantum exceeded etc. (caused an interrupt); O/S taken over control of the CPU; Saving registers into PCB for Process A, and move process PCB to corresponding queue (ready or blocked queue); Update PCB of the selected process, and memory management data structure; Load context (registers and PCB etc.) for Process B; Process B resumes execution.

Process Creation A process may create several new processes The creating process: parent The new processes: children

When a process creates a new process: The parent continues to execute concurrently with its children, OR The parent waits until some or all of its children have terminated.

Two possibilities in terms of address space of the new process The child process is a duplicate of the parent process The child process has a program loaded into it.

E.g. In Unix… Each process is identified by its process identifier System call: fork (create new process) execlp (used after fork, replace the process memory space with a new program) wait (move itseld off the ready queue) Exit (terminate the process)

C program - fork #include Main(int argc, char *argv[]){ Int pid; /* fork another process */ pid = fork(); if (pid <0) {/*error occurred */ fprintf(strderr, “Fork Failed”); exit(-1); } Else if (pid == 0) {/* child process */ execlp(“/bin/ls”, “ls”, NULL); } Else { /* parent process */ /* parent will wait for the child to complete */ Wait(NULL); Printf(“Child Complete”); Exit(0); }