Skip to content
BENIBIX Learn

Process vs Thread

A process and a thread are both ways to run work at the same time, but they differ in what they share. A process is a running program with its own memory. It is kept apart from all the others. A thread is a line of work inside a process, and it shares that memory with the other threads. Threads are cheap and share data with ease. Processes are safer, because one crash stays inside.

Development⚙️ Compilers & Runtimes

Process

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

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
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.
Full entry
Development⚙️ Compilers & Runtimes

Thread

One line of work in a running program. It shares the program's memory.

A thread is one line of work running inside a process. A process starts with one thread and can start more. All threads in a process share its memory, so they can use the same data. That makes them cheaper to start than processes and quick to share work. It also means two threads can change the same data at once, which causes bugs.

Example
Jack's photo app uses one thread to keep the screen moving. A second thread shrinks 500 photos in the background, so the app never freezes.
Why it matters
Threads let one app do several things at once and use more than one CPU core.
Full entry

In one line

Process
A running program. It has its own memory, kept apart from the rest.
Thread
One line of work in a running program. It shares the program's memory.