Operating System - Processes
What is the Process? ( Process in Operating System )
An executing Program is known as Process. A Process is executed in a defined sequence i.e, one instruction at a time. A process is the smallest alone schedulable entity, consisting of code and data.
Program
A Program is generally known as a set of instructions provided to execute a certain specified job. A computer program is generally written by a professional computer programmer in any of the Programming Languages (C, C++, Python, Java, etc.).
A simple program written in C Programming Languages for Addition looks like this:-
A code written in a computer program which performs meaningful task is known as "Algorithm".
A collection of different computer programs, libraries and meaningful data combines all together to form a "Software".
Process State
A process is an active entity that changes its state as execution proceeds.
The different States of Processes are:-
- New - Process is being created in this State for execution.
- Ready - The Process is waiting for CPU, to give instructions to proceed further.
- Running - Process starts execution after getting the instructions from the CPU.
- Waiting - Process waits for other required resources to complete execution(Input, Output, or Required files).
- Terminated - Once the process completes its execution or terminated by any reasons it goes to the terminated state and waits to be removed from the acquired memory.
The different Process States. |
Process Control Block (PCB)
The Operating System collects all information about a specific process in a data structure known as "Process Control Block" or "Process Descriptor". Process Control Block is must be created whenever a new process is created for execution and to be deleted when the process is terminated.
Following Information are stored in a PCB:-
- Process ID
- Process Priority
- Process State
- Hardware State
- I/O Information
- Scheduling Information
- Memory Related Information
- Various Pointers Information