11 process definition

23
1 Understand Process Management Process definition, Process state diagram , Sequence of process HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS

Upload: myrajendra

Post on 19-Jun-2015

537 views

Category:

Education


0 download

TRANSCRIPT

Page 1: 11 process definition

1

Understand Process Management Process definition, Process state

diagram , Sequence of process

HOME PREVIOUS TOPIC NEXTPREVIOUS QUESTION PAPERS FOR OSCPP TUTORIALS

Page 2: 11 process definition

Recap

In the last class, you have learnt about

• Definition of system call

• Types of system calls

• Single user operating system structure

• Multiuser operating system structure

2

Page 3: 11 process definition

3

Objectives

On completion of this period, you would be able

to know

• Definition of a Process

• Process State Diagram

• Sequence of Process

Page 4: 11 process definition

4

Process

• A Process is a program in execution

• A process is more than a program code, some times also

known as text section

• A process includes the current activity, as represented

by the program counter and the contents of the

processors registers

Page 5: 11 process definition

5

• A process also includes the process stack, which

contains temporary data & data section which

contains global variables

• Program by itself is not a Process

• Program is a Passive Entity

• Ex. A file stored on a disk

Process

Page 6: 11 process definition

Process

• Process is an active entity

• Ex. Program counter specifies the next

instruction to execute and set of associated

resources

• Process is known as a task or a job

• The process can be sub divided into sub processes

6

Page 7: 11 process definition

Process

• Two processes may be associated with the same

program, but they are considered as two separate

execution sequences

• Example:

– Several users may be running different copies

of mail program

– Same user may invoke many copies of editor

program7

Page 8: 11 process definition

8

Process States

• Process changes its state while it executes

• The state of a process is defined in part by the current activity of a process

• Each process may be in one of the following states

• New

• Ready

• Running

• Waiting

• Terminated

Page 9: 11 process definition

9

Process State Diagram

NEW

READY

WAITING

RUNNING

TERMINATED

Admitted

Interrupt

Scheduler dispatch

I/O or Event wait

Exit

I/O or Event completion

Figure 4.1 Diagram of Process State

Page 10: 11 process definition
Page 11: 11 process definition
Page 12: 11 process definition

12

• Programs from the secondary storage device are moved to the job queue for the execution

• Creating of a Process is called the NEW state, after creation the process enters the job queue

• Creation of a new process results in

• A name is given to the process

• Memory space is provided in the job queue

• A Process Control Block is created

• Its initial priority is assigned in the job queue

• Initial resources are allocated to it

Sequence of Process

Page 13: 11 process definition

13

•The New process which is in job queue must be

admitted to the ready queue

• Process waiting in the ready queue must be assigned

to a processor this state is called READY state

•The scheduler dispatch will assign the process to the

processor, and the instructions in the process are being

executed this state is called RUNNING state

Sequence of Process ..

Page 14: 11 process definition

14

Sequence of Process

•The running process enters the Waiting state when it

requires an I/O or an event wait

•After completion of a I/O or an event the process in the

waiting state enters the READY state

•The running process enters the ready state when a

process is interrupted by an interrupt

Page 15: 11 process definition

15

Sequence of Process

•The running process exits from a processor after

completion of its execution, this state is called

TERMINATED state

•A terminated process releases all its resources to

the resources queue and memory space to memory

pool

Page 16: 11 process definition

16

Summary

In this class, you have learnt about

• Definition of a Process• Process State Diagram• Sequence of Process

Page 17: 11 process definition

Frequently Asked Questions

1. Define a process

2. Write a brief note on a process

3. Draw process state diagram

4. Explain various process states

5. Explain the sequence of process

Page 18: 11 process definition

18

Other subject materials

• Web designing

• Micro processors

• C++ tutorials

• java

home

Page 19: 11 process definition

9CM402.11 19

Quiz

1. A process goes to wait state when it finishes execution

a) True

b) False

2. A process in the ready state is waiting to be assigned to a processor

a)True

b)False

Page 20: 11 process definition

9CM402.11 20

Quiz

3. The running process may be interrupted by an interrupt and the

process is sent back to READY state

a) True

b) False

4. Creation of a new process results in

a) A name is given to the process

b) Memory space is provided in the job queue

c) Both

d) None

Page 21: 11 process definition

9CM402.11 21

Quiz5. Process is an active entity

a) YES

b) NO

6. Process can be divided into sub processes

a) YES

b) NO

Page 22: 11 process definition

22

Quiz7. Program is an active entity

a) YES

b) NO

8. A process includes a process stack and data section

a) YES

b) NO

Page 23: 11 process definition

23

Other subject materials

• Web designing

• Micro processors

• C++ tutorials

• java

home