The full picture
| Process | Thread | |
|---|---|---|
| Address space | Own (page tables per process) | Shared with siblings |
| Owns | FDs, credentials, signal handlers, memory | Stack, registers, PC, scheduling state |
| Creation cost | Heavier (new address space; fork+COW helps) | Light (allocate stack + kernel object) |
| Failure blast radius | Contained — kernel cleans up everything | One bad thread can take down the whole process |
| Communication | IPC: pipes, sockets, shared memory (explicit) | Plain memory (fast, and racy) |
- The kernel actually schedules threads (tasks), not processes — a process is better thought of as a resource container whose threads are the schedulable things.
- What's in the per-thread kernel state: kernel stack, saved registers, scheduling class/priority; what's per-process: page-table pointer, FD table, memory maps, limits.
- Architecture echoes: Chrome's process-per-site (isolation over memory), nginx's worker processes vs a JVM's thread pool, and PostgreSQL's process-per-connection vs MySQL's thread-per-connection — all the same dial.
- A JVM is one process; every Java
Threadwas (pre-virtual-threads) a 1:1 kernel thread inside it — which is why one OOM or segfault kills all of them together.