What is the difference between process and program?

Operating SystemHardwareSoftware & Coding

To begin with, let us learn about the process.

Process

A process is a program in execution and it is more than a program code called a text section and this concept works under all the operating systems because all the tasks performed by the operating system needs a process to perform the task.

A process also known as one type of activity and it is used in the computer for a particular purpose and a number of states involved in this concept.

A process is one type of state and the state of a process is defined in part by the help of different activity and a process has different types of a state.

A process includes the process stack which contains the following −

  • Temporary data like function parameters, return address, local variables.

  • Data section contains global variables.

  • Heap which is a memory dynamically allocated during process runtime.

The process is represented below −

Stack
-
-
-
Heap
Data
text

                         Max

Program

A program by itself is not a process. A program is a passive entity such as a file which contains a list of instructions stored on a disk often called an executable file.

A process is an active entity with a program counter specifying the next instruction to execute and a set of associated resources.

A program becomes a process when an executable file is loaded into memory.

Differences

The major differences between program and process in the form a table are as follows −


ProgramProcess
Consists ofInstructions in any programming languageInstructions in machine code
FSStatic objectDynamic object
Resides inSecondary storageMain memory
Span of timeUnlimitedLimited
EntityPassiveActive
raja
Updated on 29-Nov-2021 10:42:08

Advertisements