Pairs with Lesson 5: Blocking I/O and Scheduling.
| Term | Meaning |
|---|---|
| Process | An isolated unit of execution with its own memory space, file descriptors, and address space. One process cannot see into another's memory directly. |
| Thread | A unit of execution within a process. Threads in the same process share that process's memory; each thread keeps its own stack and register state. |
| Context switch | The OS saving the currently running thread's registers and stack pointer, then loading a different thread's saved state so it can resume. Has real but small overhead compared to the I/O wait it enables. |
| Blocking syscall | A system call (e.g. read() on a socket with no data yet, a disk read) that cannot return immediately. The kernel parks the calling thread instead of spinning the CPU on it. |
| Scheduler | The kernel component that decides which runnable thread gets to run on which core next, and moves threads between states as syscalls block, I/O completes, or time slices expire. |
| Running | Thread state: actually executing on a CPU core right now. |
| Runnable | Thread state: ready to execute, just waiting for the scheduler to give it a core. |
| Blocked / waiting | Thread state: waiting on something external (I/O, a lock, a timer). Not eligible to run even if a core is free. An interrupt moves it back to runnable when the wait ends. |
| I/O-bound workload | Work where threads spend most of their time blocked on network or disk, not computing. Benefits from more concurrency than the core count. |
| CPU-bound workload | Work where threads spend most of their time actually running on a core. Adding more threads than cores just adds context-switch overhead, not throughput. |
More threads than cores helps only if the extra threads spend most of their time blocked on I/O, not computing. If they're mostly running (CPU-bound), extra threads past the core count just get time-sliced against each other — more context switching, no more actual throughput.