Thread
The smallest unit of CPU execution within a process, sharing the process's memory and resources.
Also: lightweight process
Definition
A thread is the smallest unit of execution within a process. Multiple threads within the same process share memory space, file handles, and other process resources, while each thread has its own program counter, stack, and register set. Multithreading enables programs to perform multiple tasks concurrently. Threads are lighter-weight than processes to create and context-switch, but shared memory introduces synchronization challenges such as race conditions and deadlocks.
Example
“A web browser uses separate threads for rendering the page, running JavaScript, and handling network requests, so a slow script does not freeze the entire browser.”
Synonyms
- execution thread
- lightweight process
- concurrent task
Antonyms / Opposites
- process
- single-threaded execution
Images
CC-licensed · free to useVideo
Related Terms
- process
- concurrency
- mutex
- deadlock
