A process is defined as a program in execution. It represents the active state of a program, meaning it is not just the static code stored on disk, but includes everything needed for the program to run. This includes the program’s code (also known as the text section), a program counter that keeps track of the next instruction to execute, a stack to store temporary data such as function parameters and return addresses, and a data section that contains global variables. In most systems, it also includes a heap for dynamic memory allocation. A process is the fundamental unit of work in a modern operating system, and the OS is responsible for managing and scheduling these processes efficiently.
- An operating system executes a variety of programs :
- Batch system - jobs
- Time-shared systems - user programs or tasks
- Process - a program in execution; process execution must progress in sequential fashion.
- A process includes
- program (text) and program counter (PC)
- stack
- data section
Process states
As a process executes, it changes states
- new : The process is being created
- running : Instructions are being executed
- waiting : The process is waiting for some event to occur
- ready : The process is waiting to be assigned to a processor
- terminated : The process has finished execution

Process Control Block
Information associated with each process, which is stored as various fields within a kernel data structure :
- Process state
- Program counter
- CPU registers
- CPU scheduling information
- Memory-management information
- Accounting information
- I/O status information

Process Creation
- Parent process create children process, which, in turn create other processes, forming a tree of processes.
- Generally, process identified and managed via a process identifier (pid).
- Resource sharing
- Parent and children share all resources
- Children share subset of parent’s resources
- Parent and child share no resources
- Execution
- Parent and children execute concurrently
- Parent waits until children terminate
- UNIX examples
forksystem call creates new processexecsystem call used after aforkto replace the process memory space with a new program
Process Termination
- Process executes last statement and asks the operating system to delete it (exit).
- Output data from child to parent (via wait)
- Process resources are deallocated by operating system
- Parent may terminate execution of children process (abort)
- Child has exceeded allocated resources
- Task assigned to child is no longer required
- If parent is exiting :
- Some operating systems do not allow child to continue if its parents terminates - all children terminated (i.e. cascading termination)