Compare

Side-by-side on the decisions that recur: process vs thread, threads vs async, mutex vs semaphore, blocking vs non-blocking I/O, container vs VM — with when to choose each.

ProcessThread
What it isA running program: its own address space, descriptor table, PID, signal stateA flow of control inside a process: its own stack and registers, everything else shared
MemoryPrivate; sharing needs explicit IPC or shared memoryShared heap and globals by default — fast, and the source of every data race
Creation costfork() copies page tables (copy-on-write), then usually exec; ~100 µs–1 mspthread_create / CreateThread: a stack and a kernel task; ~10–50 µs
Failure isolationA segfault kills one process; the others keep runningOne thread’s crash or corrupted heap takes the whole process down
SchedulingA schedulable entity (on Linux, one task)Also a schedulable entity — the kernel schedules threads, not processes (Linux: tasks; Windows: threads)
CommunicationPipes, sockets, shared memory, signals — all cross the kernelA shared variable plus a mutex or an atomic — no kernel involved on the fast path
Runtime realityPython multiprocessing, Node cluster, prefork serversC++ std::thread, Java threads, Node worker threads, Python threads (GIL-limited for CPU work)
Choose this whenIsolation matters more than sharing: untrusted or crash-prone work, CPU-bound Python, separate security or resource limits per worker.Workers must share large mutable state cheaply and you can discipline the locking: parallel C++/Java/Rust compute, pools inside one service.