the benefits of multithreading
Suppose you are the only clerk at a help desk and one customer asks you to phone a slow warehouse and wait on hold for ten minutes. If you handle requests one at a time, every other customer in line just stands there fuming while you hold the phone. A better desk has several clerks who share the same files and the same back room: one can wait on hold while the others keep serving people. Multithreading is that second desk inside a single program — several flows of work, sharing one set of resources, so the program does not freeze whenever one part has to wait.
People reach for threads for four classic reasons. Responsiveness: a program can keep reacting to the user (redrawing a window, accepting clicks) on one thread while a slow operation runs on another, so it never appears frozen. Speed-up through parallelism: on a machine with several CPU cores, different threads can literally run at the same instant, so a big job split across threads can finish faster. Resource sharing: threads in one process already share memory and files, so they exchange data with no copying and no special channel. Economy: a thread is much cheaper to create and to switch between than a whole process, because it reuses the process's address space and resources.
Two honest cautions. First, threads buy responsiveness even on a single core (by overlapping waiting with work), but they only buy true speed-up if you have multiple cores and the work can actually be divided. Second, the speed-up is never the full multiple of the cores: parts of any job must run in sequence, and that serial fraction caps the gain (a rule of thumb known as Amdahl's law). And every benefit comes with the bill of correctness — shared mutable state means you must now reason about races, which is the hard part of concurrent programming.
A photo app that applies a filter to a 50-megapixel image can split the image into eight horizontal bands and hand one band to each of eight threads. On an eight-core CPU the filter finishes in roughly an eighth of the time, while a ninth thread keeps the progress bar moving so the window still feels alive.
Responsiveness, parallel speed-up, sharing, economy — the four reasons to thread.
Multithreading does not make a single-core machine do two computations at once — there it only overlaps waiting with work. True simultaneous computation needs multiple cores, and even then the serial part of the job limits the gain.