Program vs Process

Program:

  • It is a passive entity, it’s a static object that can exist in a file.
  • It contains the instructions or an algorithm to be executed.
  • A program exists in a single space and continues to exist as time goes forward.

Process:

  • It is a dynamic entity that is a program under execution in main memory is called process.
  • It is a sequence of instructions under execution.
  • A process exists in a limited period time.

Example:

main()
{
   int i, prod =1;
   for( i =0;i <100; i++)
      prod = prod * i
}     
   

Here program contains one multiplication( prod = prod * i) where as a process executes 100 multiplications that is for each loop.

Difference between a Process and a Program:

untitled image

Related Posts:



Categories: Operating system (OS)

11 replies

Trackbacks

  1. Introduction to Kernel - Tech Access Info
  2. Index of Operating System - Tech Access
  3. Sections of a Process - Tech Access
  4. Process States - Tech Access
  5. Process Control Block(PCB) - Tech Access
  6. Attributes of a Process - Tech Access
  7. Context Switching - Tech Access
  8. Termination of a Process - Tech Access
  9. Types of Process: Init, Zombie, Daemon and Orphan Process - Tech Access
  10. Fork() System Call - Tech Access
  11. Exec Family System Call - Tech Access

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: