Process Concept
Process Concept
Program exists at a single place and Process exists for a limited span of
continues to exist until it is deleted. time as it gets terminated after the
completion of task.
Program does not have any resource Process has a high resource
requirement, it only requires memory requirement, it needs resources like
space for storing the instructions. CPU, memory address, I/O during its
lifetime.
Program does not have any control Process has its own control block
block. called Process Control Block.
Process
A process is an instance of a program in execution.
For example, when we write a program in C or C++ and compile it, the
compiler creates binary code. The original code and binary code are
both programs. When we actually run the binary code, it becomes a
process.
Contd…
A single program can create many processes when run multiple times; for
example, when we open a .exe or binary file multiple times, multiple
instances begin (multiple processes are created).
System Calls
Process Termination
A process terminates when it finishes executing its final statement and
asks the operating system to delete it by using the exit() system call.
A parent may terminate the execution of one of its children for a variety
of reasons, such as these:
The child has exceeded its usage of some of the resources that it has been
allocated. (To determine whether this has occurred, the parent must have a
mechanism to inspect the state of its children.)
The task assigned to the child is no longer required.
The parent is exiting, and the operating system does not allow a child to
continue if its parent terminates.
A process that has terminated, but whose parent has not yet called
wait(), is known as a zombie process.
If a parent did not invoke wait() and instead terminated, thereby leaving
its child processes as orphans.
Process Pre-emption
An interrupt mechanism suspends the process executing currently and
give CPU to another process. Preemption makes sure that all processes
get some CPU time for execution.
Process Blocking
The process is blocked if it is waiting for some event to occur. This
event may be I/O as the I/O events are executed in the main memory
and don't require the processor. After the event is complete, the
process again goes to the ready state.
Types of Process
If the process is intensive in terms of CPU operations then it is called
CPU bound process. Similarly, If the process is intensive in terms of I/O
operations then it is called IO bound process.