1. Overview
Process management is one of the most important functions of an operating system. It is responsible for managing the execution of programs by creating, scheduling, synchronizing, and terminating processes while ensuring efficient utilization of system resources.
Modern computer systems rarely execute only one program at a time. Users often run:
Web browsers
Media players
Text editors
Background services
simultaneously.
To support such multitasking environments, the operating system manages multiple processes in a controlled and efficient manner.
Process management enables:
Concurrent execution of programs
CPU sharing among processes
Resource allocation
Process communication
System responsiveness
Without process management:
Only one program could execute at a time
CPU resources would be wasted
Multitasking would not be possible
Process management is therefore considered one of the core responsibilities of every modern operating system.
Objectives of Process Management
The operating system aims to:
Maximize CPU utilization
Improve system responsiveness
Ensure fair CPU allocation
Support multitasking
Prevent resource conflicts
Maintain process isolation
2. What is a Process?
A process is defined as:
A program in execution, along with its current state, execution context, and associated resources.
This definition highlights an important distinction:
A process is not merely the program code stored on disk. Instead, it represents a living and actively executing entity.
When a program begins execution, the operating system creates a process that contains:
Program instructions
Execution state
Memory allocations
Open files
CPU register contents
System resources
Thus, a process can be viewed as:
The execution environment created by the operating system for a running program.
Why Programs Need Processes
Consider a simple text editor application.
The program stored on disk contains only:
Instructions
Static data
However, when executed, the system must also maintain:
Current line being edited
Open files
Cursor position
Memory allocations
CPU execution state
All this information forms the process.
Examples of Processes
Examples of processes in a typical system include:
Web browser process
Media player process
Terminal process
Database server process
Operating system services
Each process executes independently and maintains its own execution environment.
3. Program vs Process
This distinction is one of the most important concepts in operating systems.
A program is a static entity, while a process is a dynamic entity.
| Feature | Program | Process |
|---|---|---|
| Nature | Passive entity | Active entity |
| Location | Stored on disk | Resides in memory |
| Execution | Not executing | Currently executing |
| State | No state | Multiple states |
| Resource Usage | No resources allocated | Uses CPU, memory, files |
| Lifetime | Permanent until deleted | Exists only during execution |
Program
A program consists of:
Instructions
Data
Executable code
It remains inactive until execution begins.
Examples:
Chrome.exe
Calculator.exe
Python script
Process
A process represents:
Program execution
Current CPU state
Memory allocations
System resources
Multiple processes may be created from the same program.
Example:
Opening three browser windows may create:
Browser Process 1
Browser Process 2
Browser Process 3
All originating from the same executable program.
Key Insight
A program becomes a process when:
It is loaded into memory
Execution begins
Thus:
Program + Execution Context = Process
4. Components of a Process
A process consists of several components that collectively define its execution environment.
These components can be divided into:
Memory components
Execution context
Associated resources
4.1 Memory Components
Each process receives its own address space.
A typical process memory layout contains four major regions.
High Address
+------------------+
| Stack |
| (grows downward)|
+------------------+
| |
| Heap |
| (grows upward) |
+------------------+
| Data Segment |
+------------------+
| Text Segment |
+------------------+
Low Address
Text Segment
The Text Segment contains:
Executable machine instructions
Program code
Characteristics:
Usually read-only
Shared among identical processes
Example:
Compiled instructions of a C program
Data Segment
Stores:
Global variables
Static variables
Heap
Used for:
Dynamic memory allocation
Memory is allocated at runtime using:
malloc()
calloc()
new
The heap generally:
Grows upward
Stack
Stores:
Function calls
Local variables
Return addresses
The stack generally:
Grows downward
Importance of Process Memory Isolation
Each process typically has:
Independent stack
Independent heap
Independent address space
This prevents processes from:
Corrupting each other's memory
Accessing unauthorized data
4.2 Execution Context
Execution context represents the current state of CPU execution.
When the CPU switches between processes, this context must be saved and restored.
Major components include:
Program Counter (PC)
The Program Counter stores:
Address of the next instruction to execute
Without the program counter:
Execution could not resume correctly
CPU Registers
Registers store:
Intermediate calculations
Function parameters
Temporary values
These registers represent the current computational state.
Stack Pointer (SP)
The Stack Pointer identifies:
Current top of stack
Used for:
Function calls
Return operations
Local variable management
Processor Status Information
Stores:
Condition flags
Execution mode
Interrupt status
Together, these elements form the complete execution context of a process.
4.3 Resources
Processes require additional resources beyond memory and CPU state.
Examples include:
Open Files
Files currently being used by the process.
Examples:
Documents
Databases
Configuration files
I/O Devices
Processes may access:
Printers
Keyboards
Network interfaces
Storage devices
Memory Allocations
The operating system tracks:
Virtual memory regions
Shared memory
Dynamic allocations
Network Connections
Processes may own:
TCP sockets
UDP sockets
Network sessions
These resources are managed and protected by the operating system.
5. Process as a Unit of Work
The operating system treats a process as the fundamental unit of execution.
The CPU scheduler allocates processor time to:
Processes
not directly to programs.
Each process represents an independent unit of work that can:
Execute instructions
Request resources
Communicate with other processes
Key Characteristics
Independent Execution
Each process executes independently.
Own Address Space
Processes have separate memory regions.
Concurrent Execution
Multiple processes may execute concurrently.
Schedulable Entity
CPU scheduling algorithms operate on processes.
6. Role of the Operating System in Process Management
The operating system performs numerous tasks related to process management.
Process Creation
The OS creates new processes when:
Programs are launched
Child processes are spawned
Process Termination
The OS removes processes after:
Successful completion
User termination
Errors
Process Scheduling
The scheduler determines:
Which process executes next
How long it executes
State Management
The OS tracks process states such as:
Running
Ready
Waiting
Resource Allocation
Resources allocated include:
CPU time
Memory
Files
Devices
Inter-Process Communication
The OS provides mechanisms for processes to:
Exchange data
Coordinate actions
7. Concurrency and Multiprogramming
Modern operating systems support multiple executing processes simultaneously.
This capability is achieved through:
Concurrency
Multiprogramming
7.1 Concurrency
Concurrency refers to the ability of multiple processes to make progress during overlapping time periods.
On a single CPU:
Only one process executes at a time
However:
Rapid context switching creates the illusion of simultaneous execution
Example:
Process A → CPU
Process B → CPU
Process C → CPU
Process A → CPU
...
Users perceive:
Multiple programs running simultaneously.
Benefits of Concurrency
Improved responsiveness
Better resource utilization
Support for multitasking
7.2 Multiprogramming
Multiprogramming involves keeping multiple processes in memory simultaneously.
When one process waits for I/O:
Another process uses the CPU
This minimizes:
CPU idle time
and maximizes:
CPU utilization
Conceptual Flow
Process A → CPU
Process B → CPU
Process C → CPU
The operating system continuously switches among ready processes.
Concurrency vs Parallelism
Concurrency
Multiple tasks make progress over time.
Single CPU sufficient.
Parallelism
Multiple tasks execute literally at the same time.
Requires:
Multiple CPU cores
8. Importance of Process Management
Process management is essential because it enables efficient operation of modern computer systems.
Benefits include:
Efficient CPU Utilization
CPU resources are shared effectively.
Multitasking Support
Multiple applications run simultaneously.
Improved Responsiveness
Interactive applications remain responsive.
Process Isolation
Processes cannot interfere with one another.
Resource Sharing
System resources are managed safely.
Concurrent Execution
Multiple tasks can progress simultaneously.
Without process management:
Modern operating systems would not function effectively.
9. High-Level Process Lifecycle (Preview)
Every process typically progresses through a lifecycle managed by the operating system.
The major stages include:
Creation
Process is created and initialized.
Execution
Process actively uses the CPU.
Waiting
Process waits for:
I/O operations
Resources
Events
Termination
Process completes execution and resources are released.
The operating system continuously tracks and manages these state transitions.
Later sections will explore:
Process states
State transition diagrams
Scheduling decisions
Context switching
in much greater detail.