in Operating System
1,158 views
1 vote
1 vote

Conceptual question:

What is the difference between program and process?

any simple ,clear answer plz..

in Operating System
by
1.2k 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

1 vote
1 vote

A program under execution is called as process

More explanations : http://javaconceptoftheday.com/differences-between-program-vs-process-vs-threads/

by
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.

by

Related questions