Skip to content
Core CSintermediate · 65 min

Operating Systems

How the OS manages processes, threads, memory and I/O. Understand scheduling, concurrency hazards (deadlock, races), virtual memory and paging, and the process/thread distinction.

Processes vs threads

A process has its own address space; threads share their process's memory, making them lighter to create and switch but prone to data races. Context switching saves/restores state and has a cost. Inter-process communication needs explicit channels (pipes, sockets, shared memory).

Concurrency hazards

Race conditions occur when outcomes depend on timing of unsynchronized access to shared state. Deadlock needs four conditions (mutual exclusion, hold-and-wait, no preemption, circular wait) — break any one to prevent it. Mutexes, semaphores, and condition variables coordinate access.

Virtual memory & paging

Virtual memory gives each process a private, contiguous-looking address space mapped to physical frames via page tables. Pages can be swapped to disk; a page fault loads them on demand. The TLB caches translations. This enables isolation and using more memory than physically present.

Resources

Practice & test yourself

Take the quiz →