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
Buffering & Spooling in Operating System
Introduction
Buffering aur Spooling Operating System (OS) ke important techniques hain jo Input/Output (I/O) operations ko fast aur efficient banane ke liye use ki jati hain. Yeh techniques slow I/O devices aur fast CPU ke beech speed difference ko balance karti hain taaki system smoothly chale.
1. Buffering in Operating System
Buffering Kya Hota Hai?
Buffering ek aisi technique hai jisme temporary memory area (buffer) use hoti hai jo data ko temporarily store karti hai jab tak wo slow device process na kar sake.
Example:
Jab tum online video dekhte ho, toh pehle buffering hoti hai taaki video smoothly chale bina rukawat ke.
Buffering Ke Types
-
1. Single Buffering
-
Ek buffer hota hai jo data ko temporarily store karta hai.
-
Data likhne ke baad buffer khali hota hai aur firse use hota hai.
-
Thoda slow ho sakta hai agar I/O device bhi slow ho.
Example: USB se computer me file copy karna.
-
-
2. Double Buffering
-
Do buffers use hote hain taaki CPU aur device ek saath kaam kar sakein.
-
Jab ek buffer use ho raha hota hai, tab dusre buffer me data load hota hai.
-
Single buffering se better performance deta hai.
Example: Video streaming apps smooth playback ke liye double buffering use karti hain.
-
-
3. Circular Buffering (Multiple Buffers)
-
Multiple buffers ko circular queue me organize kiya jata hai.
-
High-speed data transfer ke liye best method hai.
Example: Audio processing ke real-time applications me use hota hai.
-
Diagram of Buffering Process
+---------+ +--------+ +--------+
| Process | --> | Buffer | --> | Device |
+---------+ +--------+ +--------+
-
Process → Data generate karta hai aur buffer me store karta hai.
-
Buffer → Data temporarily hold karta hai.
-
Device → Buffer se data read karta hai apni speed ke hisaab se.
Buffering Ke Advantages
CPU waiting time reduce hota hai.
CPU aur I/O devices ke beech speed difference balance hota hai.
System ki performance improve hoti hai.
Buffering Ke Disadvantages
Extra memory (buffer) ki zaroorat hoti hai.
System complexity badh jati hai.
2. Spooling in Operating System
Spooling Kya Hota Hai?
Spooling (Simultaneous Peripheral Operations Online) ek advanced buffering technique hai jisme slow devices ke liye data ko temporary storage (spool) me store kiya jata hai aur fir sequentially process kiya jata hai.
Example:
Jab tum multiple documents print karne ka command dete ho, toh yeh sabhi queue (spool) me store hote hain aur printer ek ek karke unhe print karta hai bina CPU ko slow kiye.
Spooling Kaise Kaam Karta Hai?
-
Data temporary memory ya disk me store hota hai (spool).
-
CPU apna kaam continue karta hai, jabki slow I/O device (jaise printer) baad me data process karta hai.
-
Jab device free hota hai, toh wo spool me se data fetch karke process karta hai.
Diagram of Spooling Process
+---------+ +-------+ +---------+
| Process | --> | Spool | --> | Printer |
+---------+ +-------+ +---------+
-
Process → Data generate karta hai (jaise print command).
-
Spool (temporary storage) → Data ko queue me store karta hai.
-
Printer (ya slow device) → Queue me se data fetch karke sequentially process karta hai.
Difference Between Buffering & Spooling
Feature | Buffering | Spooling |
---|---|---|
Purpose | Temporary storage for speed synchronization | Queueing system for slow devices |
Storage | RAM (Primary Memory) | Disk (Secondary Memory) |
Usage | Reading/writing files, streaming | Printing, batch processing |
Example | Video buffering | Print spooler in Windows |
Spooling Ke Advantages
CPU bina rukawat kaam karta hai jabki I/O operation background me chalta rahta hai.
System efficiency badhti hai.
CPU ka idle time reduce hota hai.
Spooling Ke Disadvantages
Extra storage ki zaroorat hoti hai.
Bahut zyada spooling hone par system slow ho sakta hai.
3. Conclusion (Summary)
Buffering aur Spooling dono hi OS ke important techniques hain jo I/O performance improve karti hain.
Buffering data ko temporary memory (RAM) me store karti hai taaki slow devices fast ho sakein.
Spooling data ko disk me queue ke roop me store karta hai aur sequentially process karta hai.
Buffering ka use video streaming, data transfer aur I/O operations me hota hai.
Spooling ka use printing aur batch processing systems me hota hai.