Lesson 050

Processes & Threads

Address spaces, the PCB,<br>context switches & threads

1:00

How the OS turns a program into a process, what the PCB tracks, how threads share memory within a process, and why that sharing is both powerful and dangerous.

By the end, you can

  • Explain the difference between a program (file on disk) and a process (running instance with address space and PCB).
  • Name the four segments of a process address space and state the purpose of each.
  • List the six fields of a PCB and explain why each is needed.
  • Trace a process through all five states and name the transitions between them.
  • Describe the steps of a context switch and explain why it is pure overhead.
  • Explain what fork() and exec() each do and how they combine to launch a new program.
  • State what threads share and what is private per thread, and correct the misconception that threads have separate heaps.
  • Explain why same-process thread switching is cheaper than process switching (TLB flush, cache warmth).
  • Distinguish user-level from kernel-level threads and explain the blocking hazard of user-level threads.
  • Compare the isolation-vs-sharing trade-off of processes versus threads, and name three IPC mechanisms.
Up next in Computer Architecture & Operating Systems
Questions or feedback?