basic concept of process

12
Basic concept of Process Prepared By: Nabinraj Dahal

Upload: nabin-dahal

Post on 13-Jan-2017

369 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Basic concept of process

Basic concept of Process

Prepared By:Nabinraj Dahal

Page 2: Basic concept of process

Contents• Process• Features of process• Process model• Process termination• Process state• Process Control Block(PCB)

Page 3: Basic concept of process

Process• a program in execution; process execution must progress in sequential

fashion• A process is an instance of a program in execution• A process will need certain resources-such as CPU time, memory,

files, and I/O devices-to accomplish its task.• These resources are allocated to the process either when it is created

or while it is executing• A process is the unit of work in most systems

Page 4: Basic concept of process

Process (cont….)• Program is passive entity stored on disk (executable file), process is

active • One program can be several processes• Consider multiple users executing the same program

Page 5: Basic concept of process

Features of process• Dynamic • Part of a program in execution• A live entity, it can be created, executed and terminated• It goes through different states wait running Ready etc• Requires resources to be allocated by the OS• One or more processes may be executing the same code.

Page 6: Basic concept of process

Process model

Page 7: Basic concept of process

Process termination• Normal exit (voluntary)• Error exit (voluntary)• Fatal error (involuntary)• Killed by another process (involuntary).

Page 8: Basic concept of process

Process state

Page 9: Basic concept of process

Process state(cont…)• As a process executes, it changes state• new: The process is being created• running: Instructions are being executed• waiting: The process is waiting for some event to occur• ready: The process is waiting to be assigned to a processor• terminated: The process has finished execution

Page 10: Basic concept of process

Process Control Block(PCB)• Identifier: A unique identifier associated with this process, to

distinguish it from all other processes• State: If the process is currently executing, it is in the running state• Priority: Priority level relative to other processes.• Program counter: The address of the next instruction in the program

to be executed• Memory pointers: Includes pointers to the program code and data

associated with this process, plus any memory blocks shared with other processes.

Page 11: Basic concept of process

Process Control Block(PCB)• Context data: These are data that are present in registers in the

processor while the process is executing• I/O status information: Includes outstanding I/O requests, I/O devices

(e.g., tape drives) assigned to this process, a list of files in use by the process, and so on• Accounting information: May include the amount of processor time

and clock time used, time limits, account numbers, and so on.

Page 12: Basic concept of process

Thank you