Chapter#02 - Process Concept
Chapter#02 - Process Concept
Chapter#02 - Process Concept
Process Concept
COURSE INSTRUCTOR:
ENGR. FARHEEN QAZI, ENGR. SYED HARIS MEHBOOB, MS. FALAK SALEEM
Process Concept
Process Scheduling
Operations on Processes
Interprocess Communication
Examples of IPC Systems
Objectives
init
pid = 1
emacs tcsch
ps
pid = 9204 pid = 4005
pid = 9298
Process Creation (Cont.)
Address space
Child duplicate of parent
Child has a program loaded into it
UNIX examples
fork() system call creates new process
exec() system call used after a fork() to replace the process’
memory space with a new program
Process Termination
Some operating systems do not allow child to exists if its parent has
terminated. If a process terminates, then all its children must also be
terminated.
cascading termination. All children, grandchildren, etc. are
terminated.
The termination is initiated by the operating system.
The parent process may wait for termination of a child process by
using the wait()system call. The call returns status information and
the pid of the terminated process
pid = wait(&status);
If no parent waiting (did not invoke wait()) process is a zombie
If parent terminated without invoking wait , process is an orphan
Interprocess Communication
2) message passing
messages are exchanged between the cooperating processes
useful for exchanging smaller amounts of data.
easier to implement than is shared memory for
intercomputer communications.
implemented using system calls (more time, kernel
intervention).
Communications Models
End of Chapter 2
Thank you