Processes
An OS abstraction: address space, at least one thread, and a pile of kernel metadata.
Level: beginner
What is it?
A process is the unit of isolation: its own virtual memory, file-descriptor table, credentials, and at least one thread of execution. Creating one is expensive; isolating two from each other is the point.
Why does it matter?
Crash a process, the others live. Security boundaries, resource limits, and 'that service' as a noun — all process-shaped.
Mental model
A process is a house (address space) with one or more people in it (threads). The kernel is the city: it schedules people, meters utilities, and keeps houses from walking into each other.
How it works
- PCB / task_struct: PID, state, registers, mm_struct, files, signal mask.
- fork copies; exec replaces the image; wait reaps. Copy-on-write makes fork cheap until a write.
- Threads share the house; processes do not (unless they map shared memory on purpose).
- Isolation is virtual memory plus kernel-mediated I/O, not a pinky promise.
Real-world usage
- OS isolation
- Browsers (process-per-site)
- Containers as groups of processes
Common mistakes
- Calling a thread a process
- Forgetting zombies: a dead child still occupies a PCB until wait
Interview questions
Process vs thread?
A process is an address space and OS identity. A thread is a schedulable context. Threads in one process share memory; processes do not by default.
What does fork() return?
0 in the child, child's PID in the parent, -1 on failure.