Skip to content
Latchkey

What Is a Process? A Running Program in Isolation

A process is an instance of a running program: its own isolated memory, file handles, and at least one thread of execution, managed by the operating system.

When you launch a program, the operating system creates a process for it: a sandboxed container of memory and resources where the program runs. Each process is isolated from the others, so one crashing or misbehaving process cannot directly corrupt another. Inside a process, one or more threads do the actual work.

What a process contains

A process owns an address space (its private view of memory), open file descriptors, environment variables, and at least one thread. The OS tracks all of this and enforces isolation so processes cannot read each other memory without explicit channels.

Process vs thread

A process is isolated and heavyweight, with its own memory. A thread lives inside a process and shares its memory with siblings. Processes give safety through isolation; threads give speed through sharing. Many systems combine both.

How processes communicate

  • Pipes and sockets for streaming data between processes.
  • Shared memory segments for fast, explicit sharing.
  • Message queues and the filesystem.
  • Exit codes and signals for coarse coordination.

Why isolation matters

Because processes do not share memory by default, a crash in one does not corrupt another, and a memory leak is bounded to one process. This is why running risky or untrusted work in a separate process is a common safety pattern.

A quick example

Each step in a shell pipeline like cat log | grep error | wc -l runs as a separate process, and the OS connects their input and output through pipes.

Processes in CI

A CI job is itself a process tree: the runner spawns build and test processes and watches their exit codes. A non-zero exit fails the step. Latchkey runs each job in an isolated environment so one job cannot poison the next, and distinguishes a real non-zero exit from a transient infrastructure failure worth retrying.

Key takeaways

  • A process is a running program with its own isolated memory and resources.
  • Processes are isolated and safe; threads inside them share memory and are fast.
  • CI jobs are process trees whose exit codes decide pass or fail.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →