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.