operating-systems

Definition

Thread

A thread (execution string) is the smallest unit of execution within a process. While a process provides the execution environment and resources, a thread is the unit of dispatching — the entity the scheduler assigns to a CPU. Threads share the same address space but maintain their own program counter and stack.

Often called “lightweight processes” due to lower creation and management overhead.

Comparison

FeatureProcessThread
Resource OwnershipOwns memory space and resourcesShares the resources of its parent process
IsolationHigh; crash doesn’t affect othersLow; one thread’s crash can affect the entire process
OverheadHigh creation and switching costLow creation and switching cost
CommunicationRequires complex IPCCan communicate easily via shared memory

Benefits

Responsiveness

Multi-threaded application remains responsive while performing background tasks.

Parallelism

On multi-core systems, threads of the same process run truly simultaneously.

Efficiency

Creating a thread is faster than creating a full process — no new address space needed.