Back to list
Lv.2

Multithreading

Multithreading

A mechanism that runs multiple tasks concurrently within a single program.

In Simple Terms

Multithreading is a mechanism that runs multiple tasks concurrently within a single program. For example, a video app streaming video while simultaneously loading new comments is a classic case. By dividing work among tasks within one app, the screen stays responsive even when one task is demanding — the app keeps accepting input without freezing up.

Behind the Name

The word "multithread" combines "multi," meaning many, with "thread," which refers to a single strand or line. The name comes from picturing a program's flow of execution as a single thread — with many threads running in parallel, side by side at the same time.

Take a Closer Look!

Multithreading is a mechanism that runs multiple tasks in parallel within a single program.
When a computer runs a piece of software, this technique splits the workload into finer units and advances them simultaneously. This makes it possible to handle large data calculations while still being able to respond quickly to a user clicking a button.

The mechanism works by creating multiple threads — paths of execution — inside a single program, allowing the CPU to be used to its full potential.
Think of it like a road network: even if one lane gets blocked by a delay, the other lanes keep moving, so the overall flow of work can keep moving. Without this, the entire screen could freeze until a single task finishes.

On the other hand, running multiple tasks at the same time requires careful management of the computer's resources.
If multiple threads try to write to the same piece of data at the same moment, it can corrupt the data or cause errors. To prevent this, multithreading is combined with a process called synchronization, which coordinates the timing of operations to keep everything running safely.