OS Concepts
Processes, threads, scheduling, synchronisation and memory.
6 pages, free to read
- 1
Processes vs threads
BeginnerA process is a running program with its own private memory; threads are separate lines of execution inside one process that share that memory.
9 min read - 2
CPU scheduling
IntermediateThe CPU scheduler decides which ready thread runs next and for how long, trading off throughput, response time and fairness.
10 min read - 3
Synchronisation (locks, semaphores)
IntermediateSynchronisation tools like mutexes, semaphores and condition variables stop threads that share data from interleaving in ways that corrupt it.
11 min read - 4
Deadlocks
IntermediateA deadlock is a set of threads each waiting for a resource another one holds, so none can ever proceed; it needs four conditions, and breaking any one prevents it.
10 min read - 5
Memory management & virtual memory
IntermediateVirtual memory gives every process its own private address space, which the OS and hardware map onto physical RAM page by page, loading pages from disk only when needed.
12 min read - 6
Concurrency in practice
IntermediateReal systems handle many tasks at once with a few proven patterns (thread pools, producer-consumer queues, event loops and process pools), chosen by whether the work is I/O-bound or CPU-bound.
11 min read