Operating System
OS Part-1
OS Part-2
- File Concepts and Access methods
- Free Space Management and Allocation methods
- Directory Systems and Protection
- File Organization, Sharing and Implementation issues
- Disk and Drum Scheduling
- I/O Devices Organisation & I/O Buffering
- I/O Hardware, Kernel I/O subsystem and Transforming I/O Requests to Hardware Operations
- Device Drivers and Path Management
- Device Driver Sub Modules and Procedure
- Device Scheduler and Handler
- Interrupt Service Routine (ISR)
- File System in Linux and Windows
OS Part-3
- Process and Process Control Block(PCB)
- Process Scheduling( Preemptive and Non Preemptive)
- Scheduling Algorithms
- Algorithm Evaluation
- Multiple Processor Scheduling
- Real Time Scheduling
- Operations on Processes
- Threads
- Inter-Process Communication
- Precedence Graphs
- Critical Section Problem
- Semaphores
- Classical Problems of Synchronization
- DeadLock
- Deadlock Prevention and Avoidance
- Deadlock Detection and Recovery
- Process Management in Linux
OS Part-4
- Memory Hierarchy in OS
- Concepts of Memory Management
- MFT and MVT
- Logical and Physical Address Space
- Swapping
- Contiguous and Non Contiguous Memory Allocation
- Paging
- Segmentation
- Paging Combined with Segmentation
- Structure and Implementation of Page Table
- Virtual Memory in OS
- Cache Memory Organization
- Demand Paging
- Page Replacement Algorithms
- Allocation of Frames and Thrashing
- Demand Segmentation
OS Part-5
- Distributed Operating System: Introduction and Types
- Distributed OS: Design Issues
- Distributed OS: File System
- Distributed OS: Remote File Access
- Remote Procedure Call(RPC)
- Remote Method Invocation(RMI)
- Distributed Shared Memory
- Parallel Processing and Concurrent Programming
- Security and Threats Protection in Distributed OS
- Security Design Principles and Authentication in Distributed OS
- Sensor Network and Parallel OS
Operations on Processes in Operating System
Ek process ek running program ka instance hota hai. Operating system different operations perform karta hai taaki processes ko efficiently manage kiya ja sake. Main operations hain: Process Creation (Naya process banana)
Process Execution (Process ko run karna)
Process Suspension (Process ko temporarily rokna)
Process Termination (Process ko khatam karna)
1. Process Creation
Jab bhi ek program execute hota hai, ek naya process create hota hai.
Parent Process ek Child Process create karta hai, jo ek process hierarchy banata hai.
Steps in Process Creation:
-
Naye process ke liye memory allocate hoti hai.
-
Program code ko memory me load kiya jata hai.
-
Process ko ek unique Process ID (PID) diya jata hai.
-
Process ka PCB (Process Control Block) initialize hota hai.
-
Process ko execution ke liye schedule kiya jata hai.
Example of Process Creation:
-
Jab aap Google Chrome open karte ho, ek naya process create hota hai.
-
Jab aap Chrome me naya tab open karte ho, ek child process create hota hai.
Diagram: Process Creation
Parent Process (PID 100)
|
|---> Child Process 1 (PID 101)
|---> Child Process 2 (PID 102)
Linux me process create karne ka example (fork system call)
#include <stdio.h>
#include <unistd.h>
int main() {
int pid = fork(); // Ek naya child process create karega
if (pid == 0) {
printf("Ye child process hai\n");
} else {
printf("Ye parent process hai\n");
}
return 0;
}
2. Process Execution
Jab ek process create hota hai, toh wo different states se guzarta hai:
-
New: Naya process create hua.
-
Ready: Process execution ke liye wait kar raha hai.
-
Running: Process CPU par execute ho raha hai.
-
Waiting: Process kisi I/O ke wait me hai.
-
Terminated: Process execution complete ho gaya.
Diagram: Process States
New → Ready → Running → (Waiting) → Terminated
Example:
-
Jab aap PUBG game open karte ho, toh wo Ready state me hota hai.
-
Jab aap game khel rahe hote ho, toh process Running state me hota hai.
-
Jab aap internet disconnect kar dete ho, toh process Waiting state me chala jata hai.
3. Process Suspension
Kabhi kabhi ek process ko temporarily suspend kar diya jata hai taaki CPU aur memory efficiently manage ho sake.
Types of Suspension:
-
Suspend Ready: Process memory me hai but execute nahi ho raha.
-
Suspend Waiting: Process kisi event ka wait kar raha hai, isliye memory se disk me move kiya jata hai.
Example of Suspension:
-
YouTube video pause karna → Process suspend state me chala jata hai.
-
Mobile apps background me chalana → Process suspend ho jata hai taaki battery save ho.
4. Process Termination
Jab ek process apna kaam complete kar leta hai ya kisi error ki wajah se band ho jata hai, toh wo terminate ho jata hai.
Reasons for Process Termination:
Normal Exit: Process successfully execute ho gaya.
Error Exit: Process me koi error aa gaya (e.g., divide by zero).
Killed by OS: Operating system ne process ko forcibly terminate kar diya.
Example:
-
Jab aap Microsoft Word band karte ho, toh uska process terminate ho jata hai.
-
Agar ek application hang ho jaye, toh Task Manager se usko “End Task” karke terminate kiya jata hai.
Linux Command to Kill a Process:
kill -9 PID (Forcefully process ko terminate karega)
Conclusion
-
Operating System processes ko manage karne ke liye different operations perform karta hai.
-
Process Creation, Execution, Suspension, aur Termination ek process ke lifecycle ka part hain.
-
Process management CPU aur memory utilization ke liye bahut zaroori hai.