Operating System Related Algorithm (https://www.os-book.com/OS9/slide-dir/index.html)
December 29, 2025
π₯οΈ Operating System (OS) Concepts
βοΈ CPU Scheduling Algorithms
- π°οΈ FCFS (First Come First Serve) β simple, may cause long waiting
- β±οΈ SJF (Shortest Job First) β minimum average waiting time
- π SRTF (Shortest Remaining Time First) β preemptive SJF
- π RR (Round Robin) β time-sliced, fair for all processes
- π§© MLQ (Multilevel Queue) β multiple queues with priorities
π§ Memory Management
- π Paging β fixed-size pages, no external fragmentation
- π§± Segmentation β logical division (code, stack, data)
- π Virtual Memory β illusion of large memory using disk
π Page Replacement Algorithms
- π₯ FIFO β first loaded page removed (Beladyβs anomaly β)
- π§ LRU β removes least recently used page
- π― Optimal β replaces page used farthest in future (theoretical)
π File Allocation Methods
- π¦ Contiguous Allocation β fast access, fragmentation issue
- π Linked Allocation β no fragmentation, slow access
- ποΈ Indexed Allocation β uses index block, balanced approach
π½ Disk Scheduling Algorithms
- π°οΈ FCFS β simple, inefficient head movement
- π― SSTF β shortest seek time first
- π SCAN (Elevator) β moves back and forth
- π C-SCAN β circular scan, uniform waiting
- π LOOK β scan only till last request
- π C-LOOK β circular version of LOOK
π Deadlock Handling
- π« Deadlock Prevention β eliminate conditions
- π‘οΈ Deadlock Avoidance β safe state checking
- π¦ Bankerβs Algorithm β resource safety algorithm
- πΈοΈ Resource Allocation Graph (RAG) β detect deadlocks visually