What is Process and its states
Process
Program जब Under execution mode में होता है तो उसे Process कहते हैं | इसमें Program Counter, Process Stack, Register, Program Code आदि Included होते हैं | जबकि Program Code एक Text Part है | एक Program अपने आप में एक process नहीं है क्योंकि program एक passive Entity होती है | जैसे – File के Content.
जबकि process एक Active entity हैं जिसमे Program Counter एवं अन्य Resources Included होते है |
Process States
एक Process Execution के दौरान अपने States को Change करता है | States partially, Process के Current Activity पर Dependent होते हैं | Process Execution के दौरान जिन different States से होकर गुजरता है, उन्हें Diagram के द्वारा प्रदर्शित किया गया है |
States of Process
- New – Process जब create होती है तो वह New State में रहती है |
- Ready – इस State में process Short Term Scheduler द्वारा processor assign करने का wait करता है |
- Running – इस State में Processor द्वारा Instruction को Execute किया जाता है |
- Waiting – इस State में Events (I/O) के occur होने का wait किया जाता है |
- Terminated – Process ने अपना Execution Complete कर लिया है |
Process Control Block
एक Process Control Block (PCB) प्रत्येक Process के साथ जुड़ा होता है | एक Process Create करते समय Operating System कई Operation करता है | Processes की पहचान करने के लिए प्रत्येक Process को Process Identification Number (PID) assign किया जाता है | Operating System, Multi-Programming को Support करता है इसीलिए इसे सभी Process का Track रखने की जरूरत है | अतः Process Control Block (PCB) का उपयोग Process की Execution Status को Track करने के लिए किया जाता है | Memory के प्रत्येक Block में Process states, Program Counter, Stack Pointer, Open की गयी File का Status, Scheduling Algorithm आदि की Information Store होती है | इन सभी Information को Process के एक State से दूसरे State में जाने पर PCB में Update किया जाता है | जिससे की Process का Execution सुचारु रूप से चलता रहे |
PCB में निम्नलिखित Component होते हैं –
- Process State : यह specific Process के State से सम्बंधित (New, Ready, Running, Waiting, terminated) Information को Store रखता है |
- Process Number : यह Specific Process की संख्या को Store रखता है |
- Program Counter : यह Next Instruction के Address को Store रखता है जिसे Process में Execute करने की आवश्यकता होती है |
- Register : यह Process द्वारा Use किये जाने वाले Register (Accumulator, Index Register, Stack Pointer, General Purpose Register) को Specify करता है |