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
Real-Time Scheduling in Operating System
Introduction
Real time scheduling ek aisa scheduling mechanism hai jo time-critical applications ke liye use hota hai. Isme processes ko fixed deadlines ke andar complete karna hota hai. Agar deadline miss hoti hai, toh system fail ho sakta hai.
Real-Time Systems ke Features
Predictability: Tasks ko fixed time ke andar execute hona hota hai.
Priority-Based Execution: High-priority tasks ko pehle execute kiya jata hai.
Minimal Jitter: Tasks execution me delay minimum hona chahiye.
Resource Reservation: CPU, memory, aur I/O devices ko allocate karna padta hai taaki deadlines meet ho sakein.
Types of Real-Time Systems
1. Hard Real-Time Systems
Deadlines strict hoti hain. Agar ek bhi deadline miss ho jaye, toh system fail ho sakta hai.
Example:
Airbag deployment system in cars
Medical systems like pacemakers
Industrial automation
Diagram:
Task |—-|—-|—-| (strict deadlines me complete hona chahiye)
2. Soft Real-Time Systems
Deadlines ko follow karna zaroori hai, par ek chhoti delay allow hoti hai.
Example:
Online video streaming
(Frame drop allow hota hai)
Online gaming
(Some lag acceptable)
Diagram:
Task |—-|—-|—>| ( Thoda delay hosakta hai pr jaldi complete hona chahiye)
Real-Time Scheduling Algorithms
1. Rate Monotonic Scheduling (RMS)
Fixed priority-based scheduling algorithm hai.
Jitna chhota period hoga, utni high priority milegi.
Example:
Suppose system me do tasks hain:
T1 (Period = 4ms, Execution Time = 1ms)
T2 (Period = 6ms, Execution Time = 2ms)
T1 ki priority T2 se zyada hogi kyunki uska period chhota hai.
Diagram:
Time:0 1 2 3 4 5 6 7 8 9 10 11 12
Task:T1 T2 T2 - T1 T2 T2 - T1 T2 T2 -
Advantages: Simple aur predictable hai.
Disadvantages: CPU utilization ka limitation hota hai (~69%).
2. Earliest Deadline First (EDF)
Dynamic priority scheduling algorithm hai.
Jo task sabse pehle complete hone wala hota hai, usko highest priority milti hai.
Example:
Task | Arrival Time | Execution Time | Deadline |
---|---|---|---|
T1 | 0ms | 2ms | 5ms |
T2 | 1ms | 1ms | 4ms |
Scheduling:
Time: 0 1 2 3 4 5 6
Task: T1 T1 T2 - - -
T2 ki deadline pehle hai (4ms), isliye pehle execute hoga.
EDF ensures ki sabhi tasks apni deadline se pehle complete ho sakein.
Advantages: CPU utilization 100% tak ho sakta hai.
Disadvantages: Algorithm complex ho sakta hai.
3. Least Laxity First (LLF)
Laxity = Deadline – (Current Time + Remaining Execution Time)
Jiska laxity sabse kam hota hai, usko highest priority milti hai.
Example:
Task | Execution Time | Deadline | Laxity |
---|---|---|---|
T1 | 2ms | 6ms | 4ms |
T2 | 1ms | 4ms | 3ms |
T2 ka laxity kam hai, toh pehle execute hoga.
Advantages: Deadline miss hone ka risk kam hota hai.
Disadvantages: Frequent calculations lagti hain.
Comparison of Real-Time Scheduling Algorithms
Algorithm | Type | Priority | Complexity | CPU Utilization |
---|---|---|---|---|
RMS | Fixed Priority | Static | Low | ~69% |
EDF | Dynamic Priority | Dynamic | Medium | 100% |
LLF | Dynamic Priority | Dynamic | High | 100% |
Conclusion
Real-Time Scheduling ka use time-critical systems me hota hai.
Hard Real-Time Systems me deadlines strict hoti hain, jabki Soft Real-Time Systems me slight delays allow hote hain.
RMS, EDF, aur LLF jaise scheduling algorithms system ki efficiency improve karne ke liye use hote hain.