What is a Process
A process is a running program. A program sitting on disk is just a file — a sequence of bytes. When the operating system loads it into memory and starts executing it, that becomes a process. Each process is an isolated environment with its own memory, its own file descriptors, and its own CPU state.
How it works
When you start a program, the OS creates a process by:
- Allocating virtual memory — the process gets its own address space with a stack, a heap, and regions for code and data.
- Assigning a PID — a unique integer that identifies this process.
- Opening file descriptors — at minimum, stdin (0), stdout (1), and stderr (2).
- Setting CPU state — the instruction pointer starts at the program's entry point.
The OS scheduler decides when each process gets CPU time. A process can be in several states: running, ready (waiting for CPU), sleeping (waiting for I/O), or stopped (paused by a signal).
Processes are isolated from each other. One process cannot read or write another's memory — virtual memory enforces this. To communicate, processes use explicit mechanisms: pipes, sockets, shared memory, or files.
A process can create child processes using fork (on Unix). The child gets a copy of the parent's memory and file descriptors but runs independently. The parent can wait for the child to finish and collect its exit code.
Why it matters
Every program you run is a process. Your shell, your browser, your database — each is one or more processes managed by the OS. Understanding processes explains how programs are isolated, how they communicate, how the OS shares CPU time among them, and how containers build on process isolation to create lightweight environments.
See How Processes Work for the full lifecycle.