Skip to main content

What is process; process vs thread

Short answer

A process is a program in execution with its own resources and address space. Threads are lightweight execution units within a process, sharing the address space and resources, which makes creation and context switching cheaper than for processes.

What is a process? Differentiate between process and thread.

A process is a program in execution: an active entity that includes the program code, program counter, registers, stack, data and the resources (open files, address space) allocated to it. The OS keeps its details in a process control block.

Process vs thread

A thread is a lightweight process: the basic unit of CPU utilization within a process.

BasisProcessThread
DefinitionProgram in execution, a resource ownerUnit of execution inside a process
Address spaceOwn address spaceShares the address space of its process
ResourcesOwn files, memory, I/OShares them; has only its own stack, registers and PC
Creation and switching costHighLow
CommunicationThrough IPC (slow)Through shared memory (fast)
IndependenceIndependent, protectedDependent; one thread can affect others
ExampleTwo separate programs, such as a browser and a text editorThe typing, spell-check and auto-save threads inside one word processor

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 2 questions →