⚙️Thread
Also known as Threads, Thread of Execution, Multithreading
One line of work in a running program. It shares the program's memory.
Think of it like
Think of it like cooks sharing one kitchen. They work at the same time, using the same pots.
Example
Jack's photo app uses one thread to keep the screen moving. A second thread shrinks 500 photos in the background, so the app never freezes.
Why it matters
Threads let one app do several things at once and use more than one CPU core.
Definition
Common mistake
Key takeaways
- 1Inside a process. One or many.
- 2Shared memory. Same data for all.
- 3Needs care. Locks around shared data.