A process can be thought as a program in execution, but a program by itself is not a process. Process is nothing but a set of instruction to be executed. Multiple instances of a single process can be running at any given time and also a process may create sub-processes with time. Processes may need certain resources like, CPU time, memory, files and access to other devices.
As being said, process is a set of instruction, it can be considered that a batch job is a process. CPU execute instructions in a process in a sequential manner, one instruction after another until the process is complete.
A process is more than the program code. It includes the current activity which is the value of the program counter, and the contents of the processors registers, a process stack containing temporary data and a data section containing global variables.
The operating system is responsible for the following operations in connection to process management.
- Creation and deletion of both user and system processes
- Suspension and resumption of processes
- Provision of mechanism for process
- Deadlock handling
Each process in progress may be in one of the following states
- New: The process is being created.
- Running: Instructions from the process are being executed.
- Waiting: The process is waiting for some event to occur, like an I/O activity etc.
- Ready: The process is waiting to be assigned to a processor
- Terminated: The process is completed.