Chapter 2 (Hindi)
1. Process concept
Process क्या है?
Process एक ऐसा program होता है जो execution में होता है।
उदाहरण के लिए, जब हम C या C++ में program लिखते हैं और उसे compile करते हैं, तो compiler binary code बनाता है। Original code और binary code दोनों ही programs होते हैं, लेकिन जब हम उस binary code को run करते हैं, तब वह एक process बन जाता है।
Process vs Program
- Process एक active entity होता है।
- जबकि program एक passive entity होता है।
Multiple Processes
एक ही program से कई processes बन सकते हैं।
उदाहरण के लिए, जब हम किसी .exe या binary file को कई बार open करते हैं, तो हर बार एक नया instance शुरू होता है, यानी multiple processes create होते हैं।
Process Memory Representation
Memory में एक process कई अलग-अलग sections में divide होता है, और हर section का अपना अलग purpose होता है।
👉 एक process memory में सामान्यतः इस प्रकार दिखाई देता है:
- Code Section (Text Section) → इसमें program का actual code store होता है।
- Data Section → इसमें global और static variables store होते हैं।
- Heap → dynamic memory allocation के लिए उपयोग होता है।
- Stack → function calls, local variables और execution context को store करता है।

-
Process Memory Sections
1. Text Section
Text Section (या code segment) में executable instructions होते हैं।
यह आमतौर पर read-only section होता है।
2. Stack
Stack में temporary data store होता है, जैसे:
- function parameters
- return addresses
- local variables
3. Data Section
Data Section में global variables store होते हैं।
4. Heap Section
Heap Section में runtime के दौरान process को dynamically memory allocate की जाती है।
Attributes of a Process
एक process के कई महत्वपूर्ण attributes होते हैं जो Operating System को उसे manage और control करने में मदद करते हैं।
ये सभी attributes एक structure में store होते हैं जिसे Process Control Block (PCB) या task control block कहा जाता है।
PCB में stored मुख्य जानकारी
1. Process ID (PID)
हर process को एक unique number दिया जाता है जिसे PID कहते हैं, जिससे OS उसे पहचान सके।
2. Process State
यह process की current स्थिति दिखाता है, जैसे:
- running
- waiting
- ready
3. Priority & CPU Scheduling Information
यह data OS को यह तय करने में मदद करता है कि अगला process कौन सा run होगा, जैसे:
- priority level
- scheduling queues के pointers
4. I/O Information
इसमें उन input/output devices की जानकारी होती है जिन्हें process उपयोग कर रहा है।
5. File Descriptors
यह open files और network connections की जानकारी रखता है।
6. Accounting Information
यह process के run होने का समय, CPU time usage और अन्य resource usage को track करता है।
7. Memory Management Information
इसमें process को allocate की गई memory की पूरी जानकारी होती है, जैसे:
- memory location
- memory layout (stack, heap आदि)