Process management

19
PROCESS MANAGEMENT By : Birju Tank((141060753017) IEEE Seminar on Operating System Programming At: GTU PG SCHOOL,GANDHINAGAR

Transcript of Process management

Page 1: Process management

PROCESS MANAGEMENT

By :

Birju Tank((141060753017)

IEEE Seminar on Operating System Programming

At: GTU PG SCHOOL,GANDHINAGAR

Page 2: Process management

IEEE Papers Overview

Paper:1 Process Management in DistributeSystem [1] represents the how one processexecuting step by step in Program and DistributedSystems at initial stage.

Paper:2 Developing Complex Systems -Incorporating Human Variability into the Process[2] represents the process with the comparison ofhuman variability.

Paper:3 Dynamic Process Migration Framework[3] represents the process migration from onemachine to other machine , basically work on theDistributed Systems.

Page 3: Process management

Contents

IEEE Papers Overview

What is Process?-Introduction

Processes and Process Management

Process Life Cycle

Context Switching

Process Control Block

Scheduling

Process Control and Process Handling Commands

Advantages and Disadvantages

Conclusion

References

Page 4: Process management

What is Process?

A process is a program during execution.

o Program = static file (image) that contains code to execute

o Process = executing program = program + execution state.

A process is the basic unit of execution in an operating system

o Each process has a number, its process identifier (pid).

Different processes may run different instances of the same program

o E.g., my javac and your javac process both run the Java compiler

At a minimum, process execution requires following resources:

o Memory to contain the program code and data

o A set of CPU registers to support execution

Page 5: Process management

Process in Memory

(b, *p) - main

(a) - fun

heap (p)

(char[1000])

data (aa, buf)

text (code)

0

Process memory

Stack

Max

int aa;

char buf[1000];

void fun() {

int a;

}

main() {

int b;

char *p;

p = new char[1000];

fun();

}

Page 6: Process management

Process and Process Management

A program consists of code and data

On running a program, the loader:

reads and create the executable file

sets up the process’s memory to contain the code & data fromexecutable

pushes arguments on the stack

sets the CPU registers properly & calls

When Program starts running

main(args) {

initialize_java();

ret = main(args);

exit(ret)

}

We can say “process” is now running, When main() returns, OScalls “exit()” which destroys the process and returns all resources

Page 7: Process management

Process Life Cycle

• Processes are always either executing, waiting to execute or

blocked waiting for an event to occur

A pre-emptive scheduler will force a transition from running to ready. A

non-preemptive scheduler waits.

Page 8: Process management

Cont..

Process has an execution state

ready: waiting to be assigned to CPU

running: executing on the CPU

waiting: waiting for an event, e.g. I/O

Blocked: waiting for another process execution, e.g. I/o one,

sleep over

The OS maintains a collection of process state s

typically one queue for each state – e.g., ready, waiting, …

each PCB is put onto a queue according to its current state

as a process changes state, its PCB is unlinked from one queue,

and linked to another

Process states are change in response to events – interrupts, traps

Page 9: Process management

Process Creation and Termination

Processes are created …

o When the system boots

o By the actions of another process (more later)

o By the actions of a user

o By the actions of a batch manager

Processes terminate …

o Normally – exit

o An error due to process Blocking

o An error due to Exceptions

o Terminated (killed) by the actions a user or a process

Page 10: Process management

Process Control Block

Page 11: Process management

PCB

Contains:

o Process Identification

o Processor State Information

o Process Control Information

Attributes of Process Control Block : Process

Id(Pid) , Parent Process Id(ppid), Name, Priority,

Memory Description, Active File Description,

Register Save Area, I/O resource Description

Page 12: Process management

Context Switching

Context switch is the act of switching the CPU

from one process to another .

Reasons for Context Switching

Completion of a process

Completion of the time slice/quantum

Blocking call like I/O, Sleep call

Interrupt Occurs / An exception occurs

Page 13: Process management

Scheduling

Scheduler invokes only due to system calls.

Which process can enter running state?

Criteria depends on

– CPU Utilization

– Throughput

– Turnaround time

– Waiting time

– Response time

Scheduler loads context from top of the stack

Page 14: Process management

Process Control and Process

Handling System Calls()

OS must include calls to enable special control of a process:

Priority manipulation:

nice(), which specifies base process priority (initial priority)

Debugging support:

ptrace(), allows a process to be put under control of another process

The other process can set breakpoints, e.g. registers

Alarms and time:

Sleep puts a process on a timer queue waiting for some number of seconds, supporting an alarm functionality

Page 15: Process management

Cont..

Process Handling System Calls

1. getpid():Used to get process id

2. getppid():Used to get Parent Process id

3. exit():Used to exit and calls pending buffercontents

4. fork():Used to create child Process

5. waitpid():Used to block parent process till thecompletion of child process.

6. execl():Used to overwrites current addressspace of child process

Page 16: Process management

Advantages and Disadvantages

Advantages:

Multi-Programming and Time sharing

You Can explore complex processing in to

sub-Processing

Due to that your system became faster

Disadvantages:

Deadlock

Poor overlaps of I/O and Cpu

Page 17: Process management

Conclusion

We conclude that It is possible to build a

simple mechanism that is sufficient to realize

downloading,

migration,Exceptionhandling,checkpointhag,e

mulation and debugging in between multiple

processes are running at time. And the real

time examples are media player , Laptops ,

Cpu , TV , Mobiles etc..

Page 18: Process management

References

1. Sape J. Mullender " Process Management in a DistributedOperating System ", Centre for Mathematics & Computer ScienceAmsterdam and Computer Laboratory,Cambridge University

2. IEEEConference and Workshop on Engineering of Computer BasedSystems,”Developing Complex Systems -Incorporating HumanVariability into the Process “ 1997, by Stephanie M. White, Jerry M.Owens, Computer Science and Management Engineering C.W.Post Campus, Long Island University

3. International Conference of Information and CommunicationTechnology (ICoICT) 2013 IEEE on “Dynamic Process MigrationFramework” By Amirreza Zarrabi, Khairulmizam Samsudin andAmin Ziaeiy Department of Computer and Communication Systems,Faculty of Engineering,Universiti Putra Malaysia, 43400 UPMSerdang, Selangor, Malaysia

4. http://en.wikipedia.org/wiki/Process_Management(Computing)

Page 19: Process management

THANKING YOU!..

Any Question???