OSOperating Systems · Lesson 2 of 7
Processes
A process is a running program plus everything it owns: its memory, its open files, its identity. It's also the OS's unit of protection — each process lives in its own bubble.
A program is a file on disk; a process is that program running. Each process gets its own virtual address space (it thinks it has all of memory to itself), its own file descriptor table, an ID (PID), an owner, and a parent. Chrome with 40 tabs is dozens of processes on purpose — one tab crashing can't corrupt another.
◆ Note
Signals are the OS's way to poke a process: Ctrl+C sends SIGINT, kill sends SIGTERM (please exit — handlers can run cleanup), kill -9 sends SIGKILL (unblockable, immediate). A 'zombie' is a dead child whose parent hasn't collected its exit status yet — harmless in small numbers, a bug in large ones.
Signals are the OS's way to poke a process: Ctrl+C sends SIGINT, kill sends SIGTERM (please exit — handlers can run cleanup), kill -9 sends SIGKILL (unblockable, immediate). A 'zombie' is a dead child whose parent hasn't collected its exit status yet — harmless in small numbers, a bug in large ones.