Module Review: Process Management

Key Takeaways

  1. Process vs Program: A program is code on disk; a process is code in execution.
  2. PCB: The Kernel data structure (Passport) that stores PID, State, Registers, and Memory Limits.
  3. Context Switching: Saving one process’s state and loading another’s. Pure overhead.
  4. Threads: Lightweight units of execution sharing the same address space (Heap/Code) but having private Stacks.
  5. Scheduling:
    • FCFS: Simple, but suffers from Convoy Effect.
    • Round Robin: Fair, responsive, but context switch overhead.
    • MLFQ: Dynamic priority adjustment based on CPU vs I/O bursts.
  6. IPC: Pipes (Stream), Sockets (Network), Shared Memory (Fastest, zero-copy), Signals (Notifications).

Module Review: Process Management

[!NOTE] This module explores the core principles of Module Review: Process Management, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.

1. Interactive Flashcards

Test your recall. Click to flip.

What is the "Convoy Effect"?
When a long CPU-bound job blocks short I/O-bound jobs in an FCFS scheduler, reducing overall throughput.
What do Threads share?
Heap, Code (Text), and Global Data. They DO NOT share Stack or Registers.
What is a Zombie Process?
A process that has exited but whose parent has not yet called wait() to read its exit code.
Why is Shared Memory faster than Pipes?
It is "Zero-Copy". Data is not copied between kernel and user space; both processes map the same physical RAM.
What is the Time Slice (Quantum) in Round Robin?
The fixed amount of time a process is allowed to run before being preempted by the scheduler.

2. Cheat Sheet

Concept Description Pros Cons
Process Isolated execution unit. Safe, Stable. Heavy creation/switching.
Thread Lightweight execution unit. Fast creation/switching. Race conditions, crashes kill all.
FCFS First-Come, First-Served. Simple. Convoy Effect.
SJF Shortest Job First. Optimal wait time. Impossible to predict burst.
Round Robin Time Slicing. Fair, Response Time. Context Switch Overhead.
Pipe Unidirectional stream. Simple data flow. Slow (Kernel copy).
Shared Memory Mapped RAM. Extremely Fast. Complexity (Sync needed).

3. Next Steps

Now that you understand how processes run, let’s look at how they access data.