Operating Systems
"The OS is the government of your computer. It manages resources, provides services, and enforces laws (permissions). Without it, your fancy hardware is just expensive silicon."
1. Process Management 🏃
A process is a program in execution. The OS uses a Scheduler to decide who gets the CPU.
Scheduling Algorithms
- FCFS (First-Come, First-Served): Fair but suffers from Convoy Effect.
- SJF (Shortest Job First): Optimal average wait time, but hard to predict job length.
- Round Robin: Time slicing. Fair, good for timesharing.
- Priority: High priority first. Danger: Starvation (solved by Aging).
2. Deadlocks 💀
A situation where processes are stuck waiting for each other. 4 Conditions must hold (Coffman conditions):
- Mutual Exclusion: Resource cannot be shared.
- Hold and Wait: Process holding one resource waits for another.
- No Preemption: Resources cannot be forcibly taken.
- Circular Wait: A waits for B, B waits for C, C waits for A.
3. Memory Management 🧠
Paging: Dividing memory into fixed-size chunks (Pages). Eliminates external fragmentation.
Segmentation: Dividing memory into logical variable-sized chunks (Code, Data, Stack).
Virtual Memory: Illusion of large memory using Disk. Thrashing occurs when paging happens too frequently.
Test Your Knowledge! 🧠
Ready ka na ba? Take the practice quiz for Operating Systems to reinforce what you just learned.
Start Practice Quiz 📝