Operating System

Process Management


Process Management is one of the core responsibilities of an Operating System. A process is simply a program that is currently being executed. The operating system manages multiple processes efficiently so that users can run several applications simultaneously without conflicts.

Whenever you open a browser, play music, edit documents, or run games, the operating system creates and manages processes for each task.


What is a Process?

  • A process is an instance of a program in execution.
  • It contains program code, data, stack, registers, and memory allocated during execution.
  • Multiple processes can exist for the same program.
  • Each process has its own Process ID (PID).

Process Memory Layout

Stack
Heap
Data Section
Code Section

Process States

During execution, a process moves through different states depending on CPU availability and execution status.

  • New: Process is being created.
  • Ready: Process is waiting for CPU allocation.
  • Running: Instructions are currently executing.
  • Waiting: Process waits for I/O or events.
  • Terminated: Process execution is completed.
New
Ready
Running
Waiting
Terminated

Process Control Block (PCB)

The Process Control Block is a data structure maintained by the operating system for every process.

PCB ComponentPurpose
Process IDUnique identification number
Process StateCurrent status of process
Program CounterAddress of next instruction
CPU RegistersStores register information
Memory InformationDetails about allocated memory

Process Scheduling

Process scheduling determines which process gets CPU time. The scheduler ensures efficient CPU utilization and fairness.

  • Long-Term Scheduler: Selects processes from job pool.
  • Short-Term Scheduler: Chooses process for CPU execution.
  • Medium-Term Scheduler: Handles swapping processes.
Job Queue
Ready Queue
CPU

Context Switching

Context switching occurs when the CPU switches from one process to another. The operating system saves the current process state and loads the next process state.

Steps in Context Switching
  1. Save current process state
  2. Store PCB information
  3. Select next process
  4. Load next process state
  5. Resume execution

Threads

A thread is the smallest unit of CPU execution within a process. Multiple threads can exist inside a single process.

  • Threads share memory and resources of the same process.
  • Threads improve responsiveness and performance.
  • Examples include browser tabs and multiplayer games.
Process
Thread 1
Thread 2
Thread 3

Advantages of Process Management

  • Efficient CPU utilization
  • Supports multitasking
  • Improves system responsiveness
  • Allows concurrent execution
  • Provides better resource sharing

Summary

Process Management is responsible for creating, scheduling, executing, and terminating processes efficiently. It ensures smooth multitasking, proper CPU utilization, and effective resource sharing in modern operating systems.

Ready to test your Processes & Scheduling knowledge?

Processes & Scheduling

A short quiz for process concepts and CPU scheduling after the Processes section.

5 questions·No time limit·Instant feedback