Open In App

Difference between Program and Process

Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will understand the difference between the program and process in the operating system. But before learning the differences, we will need to know about the process and program in the operating system.

What is a Program?

When we execute a program that was just compiled, the OS will generate a process to execute the program. Execution of the program starts via GUI mouse clicks, command line entry of its name, etc. A program is a passive entity as it resides in the secondary memory, such as the contents of a file stored on disk. One program can have several processes. 

Features of a Program

  • Multiple programs can be executed by a single user.
  • All program instructions are stored in main memory, which is provided by the operating system.
  • It is an inert thing. All it is is a file with some instructions that need to be executed.
  • It is devoid of a control block.
  • The secondary memory of the system houses it.
  • One program may be linked to multiple processes. For example, a browser may have multiple tabs active at once.

What is a Process?

The term process (Job) refers to program code that has been loaded into a computer’s memory so that it can be executed by the central processing unit (CPU). A process can be described as an instance of a program running on a computer or as an entity that can be assigned to and executed on a processor. A program becomes a process when loaded into memory and thus is an active entity. 

Features of a Process

  • Every process has a certain collection of data associated with it. For instance, the name of its parents, the location of the memory space that has been allotted, and security attributes like ownership rights and credentials.
  • A process can only exist for the duration that it is being performed.
  • System resources are assigned to processes. Two instances are file descriptors and network ports.
  • Process is an active entity.
  • It has a lot of resources.
  • For it to function, it needs resources like memory address, CPU, and I/O.

Difference Between Program and Process

Program Process
Program contains a set of instructions designed to complete a specific task. Process is an instance of an executing program.
Program is a passive entity as it resides in the secondary memory. Process is a active entity as it is created during execution and loaded into the main memory.
Program exists at a single place and continues to exist until it is deleted. Process exists for a limited span of time as it gets terminated after the completion of task.
Program is a static entity. Process is a dynamic entity.
Program does not have any resource requirement, it only requires memory space for storing the instructions. Process has a high resource requirement, it needs resources like CPU, memory address, I/O during its lifetime.
Program does not have any control block. Process has its own control block called Process Control Block.
Program has two logical components: code and data. In addition to program data, a process also requires additional information required for the management and execution.
Program does not change itself. Many processes may execute a single program. There program code may be the same but program data may be different. these are never same.
Program contains instructions  Process is a sequence of instruction execution. 

Conclusion

A process is a subset of a program that is formed while the program is being executed, and this is the most important distinction to be aware of. A program is a set of instructions designed to do a certain task.


Last Updated : 25 Dec, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads