Skip to content
EduVerse

Processes & Threads

In depth

Concept

Also known as: Processen, Threads

A process is a running program with its own memory. Threads are lightweight units of execution inside a process.

Processes & Threads, explained

Written by EduVerse

What it is

When you start a program, the operating system creates a process for it: a running instance with its own memory, shielded from other processes. Inside it, one or more threads execute the code. Threads share that memory, so they can cooperate quickly but can also get in each other’s way.

Why teams use it

Processes give isolation: if one crashes, the others keep running. Threads let a single program do several things at once, like serving many requests or keeping a UI responsive during a download. The catch is shared memory, which leads to race conditions and deadlocks if threads aren’t coordinated carefully.

An example from work

Your laptop fan spins up, so you run top in a terminal and see a java process at 300 percent CPU. Since top counts each core as 100 percent, several of its threads are busy at the same time. A thread dump then shows they’re all stuck in the same loop.

Our own explanation, not a quote from the book.

In the book

Sentences from The Software Realm, Decoded that mention Processes & Threads, exactly as printed.

    6 more passages about Processes & Threads in the full book

    Read every conversation where Processes & Threads comes up, with the interactive slides and demos.

    See the book

    Where it fits

    Parallel processing, concurrency in applications

    Coverage in the book

    In depth

    Covered in depth: multiple pages with explanations, examples and simulations.

    Appears in