Process Management in Operating System
Process Management in Operating System
What is a Process?
Process is the execution of a program that performs the actions specified in that
program. It can be defined as an execution unit where a program runs. The OS helps
you to create, schedule, and terminates the processes which is used by CPU. A process
created by the main process is called a child process.
Process operations can be easily controlled with the help of PCB(Process Control
Block). You can consider it as the brain of the process, which contains all the crucial
information related to processing like process id, priority, state, CPU registers, etc.
It is the job of OS to manage all the running processes of the system. It handles
operations by performing tasks like process scheduling and such as resource allocation.
Process Architecture
Stack: The Stack stores temporary data like function parameters, returns
addresses, and local variables.
Heap Allocates memory, which may be processed during its run time.
Data: It contains the variable.
Text:
Text Section includes the current activity, which is represented by the value of the
Program Counter.
It is also accountable for storing the contents of processor registers. These are saved
when the process moves from the running state and then returns back to it. The
information is quickly updated in the PCB by the OS as soon as the process makes the
state transition.
Process States
Pr
ocess States Diagram
A process state is a condition of the process at a specific instant of time. It also defines
the current position of the process.
There are mainly seven stages of a process which are:
New: The new process is created when a specific program calls from secondary
memory/ hard disk to primary memory/ RAM a
Ready: In a ready state, the process should be loaded into the primary memory,
which is ready for execution.
Waiting: The process is waiting for the allocation of CPU time and other
resources for execution.
Executing: The process is an execution state.
Blocked: It is a time interval when a process is waiting for an event like I/O
operations to complete.
Suspended: Suspended state defines the time when a process is ready for
execution but has not been placed in the ready queue by OS.
Terminated: Terminated state specifies the time when a process is terminated
After completing every step, all the resources are used by a process, and memory
becomes free.
Summary:
A process is defined as the execution of a program that performs the actions
specified in that program.
Process management involves various tasks like creation, scheduling,
termination of processes, and a dead lock.
The important elements of Process architecture are 1)Stack 2) Heap 3) Data, and
4) Text
The PCB is a full form of Process Control Block. It is a data structure that is
maintained by the Operating System for every process
A process state is a condition of the process at a specific instant of time.
Every process is represented in the operating system by a process control block,
which is also called a task control block.