DEV Community

Cover image for Program vs Process vs Thread

Posted on

Program vs Process vs Thread


A program is simply an executable file that contains a set of instructions to complete a task. An application such as Chrome is one example.


A process is any currently running instance of a program. So one program can have several executions (copies) of it running at once. One Chrome program can have multiple tabs/windows open. A colleague compares the relationship between a program and process to the difference between a Docker image and a container; I hope that analogy makes sense :)


One process can have multiple running threads. Put simply, a thread does lightweight, singular jobs. Threads exist for added concurrency. A process can have many jobs: think saving a file, reading keyboard input, writing logs, etc. Each thread can be responsible for its own task or "subprocess" so to speak.

Top comments (1)

jimmont profile image
Jim Montgomery

This is very helpful to understand. A process is a running instance of a program, with isolated resources (memory, etc) and a collection of threads. Threads share the resources of the process, with each thread handling the scheduling and execution of respective tasks. The threads can update items in memory for other threads to do their respective thing.