Skip to content
BENIBIX Learn

Process

Development⚙️ Compilers & RuntimesConcurrency

Also known as Operating System Process, Running Process, PID

A running program. It has its own memory, kept apart from the rest.

Think of it like

Think of it like a worker with their own desk. Nobody else can touch the papers on it.

Example

Emma's laptop runs a browser, an editor and a music app. Each one is at least one process. If the editor freezes, the music keeps playing.

Why it matters

Keeping programs apart means one crash or bad app cannot take down the rest.

Definition

A process is a program that is running, with its own space in memory. The system starts it and gives it a number called a process ID. It also keeps it apart from the rest. One process cannot read another's memory unless they agree to share. If one process crashes, the others keep going. Opening the same app twice usually starts two processes.

Example code

console
$ ps -o pid,comm
    PID COMMAND
   4211 bash
   4302 ps
Each running program has its own process ID, even ps itself.

Common mistake

Thinking two processes can share a variable. They cannot, so they must talk through files, pipes or the network.

Key takeaways

  1. 1
    Own memory. Kept apart from others.
  2. 2
    Has an ID. The process ID.
  3. 3
    Fails alone. One crash, others go on.

Compare