Wednesday, March 26, 2014

7.2 PARENT AND CHILD PROCESS:

In Unix ,Process Generates Another Process.
  • A Process Generating Another Process --> Parent.
  • Newly Created Process                          --> Child. 
 Ex 1:
    Shell Creates A Process For Running The CAT Command .
    
     Shell Process ==> PARENT Process.
  
     Cat Process   ==> CHILD Process. 
     
  • When A Parent Process Creates A Child Process,A PROCESS Is said To Have Born.
  • If Process Is Active                                == Alive.
  • If Process Is Inactive(Process Is Over)  == Dead.
Ex 2:
   "$cat sample.lst | grep file" Is Given To The Shell,Two Process Are Created Simultaneously.
      
           Shell Process ==> PARENT Process.
  
           Cat Process   ==> CHILD Process.  

           Grep Process ==> CHILD Process.
  • Cat And Grep Process Are The Children Of The Same Parent But Have Different Process ID's.
  • All The Child Process Inherits The Parameters Of Their Parent Process.
  • Parent Waits For Its Child To DIE(Parent Process Waits For The Complete Execution Of Its Child Process).
  • Child Is Said To Be Orphan When Parent DIE Before Its Child.
  •  Orphan Process Are Attached To The INIT Process(With Process ID1).
NOTE:
All Command Do not Create Processes
cd,mkdir,pwd And Others Do Not Create Processes.   

7.2.1 PROGRAM AND PROCESS
    
Parent And Child Process Relationship Revels That All The Process Are Arranged In Hierarchial Form(Like Tree Structure) ==>Similar To File Organisation.

Only Difference Is ,
   File Organisation == Locational.
   Organisation        == Temporal.

Program Exists In The Single Location In Space And Exists For Any Length Of Time. 

Program Is The Static Object(Contains Entire Set Of Instruction). 

Process Is A Program In Execution(Dynamic Object,Sequence Of Instruction).
   

No comments:

Post a Comment