Difference between process and program

 

To understand the concept of operating system you need to first understand the main two terms program and process most of the people are confused between them so let’s clear the confusion and start the topic of Difference between process and program.

 

A program and a process seem like the same terms. The main difference between program 

and process is a program is a set of instructions to run a specified task, at same point the 

process is an execution of that program. Here a process is an active entity and you can say 

a program is a passive entity.

 

Let’s consider both the term different and understand both one by one.


What is a Program?


Here first question arise that what is a program, in simple words you can the program is a 

set of instruction to be execute. In batch operating system program is known as executing jobs,

at same point in real-time it is known as tasks / programs. 

 

A program is a set of instruction to achieve some output. Let’s understand by the example suppose you need to do something in firefox browser for that you have one instruction file named firefox.exe it calls program


Remember when you write some block of code and compiled it, then it generates .exe file for every code which is compiled.  


And here the remembering thing is any program never stored in primary memory it always stored in secondary memory and work through the kernel.


What is a Process?

 

As you know a process is the execution of a program. It is an active entity. If there is 

Multiple processes exist at a time It will manage by the operating system through PCB 

(Process control Block) which has some functions like program counter, stack, state 

and many more. 

 

When you have an executable file like .exe  and whenever you run that code to generate the output this is the process. Basically the process is we can say the execution of a particular file or a program. 


For example, you have written one code to do sum of two numbers and when you click on that .exe file at that time process is starts to show output on a terminal. 


Hope so you understand both the term lets take the overview of the difference between program and process.

 


Difference between program and process.

    

Program

Process

Program is a file which contains a set of instruction

The process is an execution of any program.

Program is executable. 

Non-executable.

The program has longer lifespan until you remove it.

The process has a shorter lifespan.

Program file needs some resources. like 

CPU, Memory and I/O devices if it requiers. 

Process does’t need any resource.

 

QnA

What is Program?

Program is a set of instructions. for example simple hello world program


What is process?

Process is a execution of program for example executing one program.

 

How to write os program in simple way...

You can write simple hello world program in any of the code writing application and you can run it. 


How does an operating system run a program?

An OS runs a program with the help of process management. to run a program is responsibility of process management Which decides where and how to execute your process.
Reactions

Post a comment

0 Comments