The document discusses process management in operating systems. It defines a process as a program during execution, which requires resources like memory and CPU registers. The document outlines the life cycle of a process, including the different states a process can be in like ready, running, waiting, blocked. It describes process creation and termination. The process control block (PCB) contains information needed to control and monitor each process. Context switching allows the CPU to switch between processes. Scheduling determines which process enters the running state. The document lists some common process control system calls and discusses advantages and disadvantages of process management.
1. PROCESS MANAGEMENT
By :
Birju Tank((141060753017)
IEEE Seminar on Operating System Programming
At: GTU PG SCHOOL,GANDHINAGAR
2. IEEE Papers Overview
Paper:1 Process Management in Distribute
System [1] represents the how one process
executing step by step in Program and Distributed
Systems at initial stage.
Paper:2 Developing Complex Systems -
Incorporating Human Variability into the Process
[2] represents the process with the comparison of
human variability.
Paper:3 Dynamic Process Migration Framework
[3] represents the process migration from one
machine to other machine , basically work on the
Distributed Systems.
3. 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
4. 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
5. 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();
}
6. 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 from
executable
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, OS
calls “exit()” which destroys the process and returns all resources
7. 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.
8. 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
9. 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
11. 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
12. 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
13. 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
14. 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
15. 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 buffer
contents
4. fork():Used to create child Process
5. waitpid():Used to block parent process till the
completion of child process.
6. execl():Used to overwrites current address
space of child process
16. 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
17. 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..
18. References
1. Sape J. Mullender " Process Management in a Distributed
Operating System ", Centre for Mathematics & Computer Science
Amsterdam and Computer Laboratory,Cambridge University
2. IEEEConference and Workshop on Engineering of Computer Based
Systems,”Developing Complex Systems -Incorporating Human
Variability 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 Communication
Technology (ICoICT) 2013 IEEE on “Dynamic Process Migration
Framework” By Amirreza Zarrabi, Khairulmizam Samsudin and
Amin Ziaeiy Department of Computer and Communication Systems,
Faculty of Engineering,Universiti Putra Malaysia, 43400 UPM
Serdang, Selangor, Malaysia
4. http://en.wikipedia.org/wiki/Process_Management(Computing)