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
| Feature | Process | Thread |
|---|---|---|
| Resource Ownership | Owns memory space and resources | Shares the resources of its parent process |
| Isolation | High; crash doesn’t affect others | Low; one thread’s crash can affect the entire process |
| Overhead | High creation and switching cost | Low creation and switching cost |
| Communication | Requires complex IPC | Can 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.