Day 01Part 03- Operating System Difference between programs and processes.
Contents
Difference Between Programs and Processes in Operating Systems
In an Operating System (OS), the terms Program and Process are often confused, but they are quite different. Let’s break it down!
What is a Program?
A program is a passive entity that contains a set of instructions written in a programming language (like C, Java, Python) that tells the computer what to do. It is stored on disk or memory but does not execute by itself.
.exe
file on your computer is a program.
What is a Process?
A process is an active entity that represents a running instance of a program. When a program is executed, the OS loads it into memory (RAM), assigns system resources, and creates a process.
chrome.exe
) runs as multiple processes to handle different tabs.
Key Differences Between Program and Process
Feature | Program | Process |
---|---|---|
Definition | A passive set of instructions. | An active execution of a program. |
State | Static (stored in disk). | Dynamic (runs in memory). |
Resource Consumption | Does not use CPU/memory. | Uses CPU, memory, I/O. |
Execution | Needs to be executed. | Already running. |
Example | MS Word.exe file in disk. |
Opened instance of MS Word running in RAM. |
Summary:
- A program is a set of instructions stored on disk (not running).
- A process is an executing instance of a program that uses system resources.
Would you like more details on Process States or Process Scheduling in OS?