1,433 views

7 Answers

4 votes
4 votes

Program-It is virtual kind of thing but Process-It is reality.

Suppose you write a simple c program named file.c and give it to the compiler,it will give you a file.out program,both file.c and file.out residing in a secondary memory.

In order to execute a program,the OS  will take program(file.out) and put it in to RAM i.e main memory and start executing it,while doing this OS will create some kind of data structure that is known as process.

STACK
HEAP^
static and global variable used in your program
file.out

               STRUCTURE OF PROCESS

2 votes
2 votes

In simple words a Program is set of instructions 

But a Process is nothing but a program in execution

Let us say a program

#include

int main()

{

printf(“Hello”);

}

The above program prints hello. So, now, If we compile it and make an executable,Our program is currently on disk. Long term scheduler takes it to memory which has become a process

0 votes
0 votes

Program : The executable file residing on disk .

Process : The program in execution .

now the difference is the things the program have while in execution , these things are allotted by operating system to that program . So Progam + data structures = Process . now , what are these data structures they are , data section , heap section , stack section. The executable file residing on the drives of disk just forms the code section of process. please note that the information about data section , heap section and stack (info such that how much memory should be allotted ) is present inside executable file .

In other differences process have PCB program doesn't, process have physical address space program doesn't.

Related questions

0 votes
0 votes
1 answer
1
radha gogia asked Sep 12, 2015
2,668 views
I have already gone through the stack-overflow posts but still could not clear with this concept , so plz clarify it with some examples rather than explaining its definit...
2 votes
2 votes
1 answer
3
sumit kumar asked Nov 10, 2014
3,073 views
what is the difference between livelock and deadlock?how will you explain livelock to layman?asked at an interview @iitb