What’s the difference between multiprocessing and multithreading?

326 views

What’s the difference between multiprocessing and multithreading?

In: 194

17 Answers

Anonymous 0 Comments

You’re taking about two somewhat different concepts.

(1) Multiprocessor v. Uniprocessor

Recall the allied effort to break German codes in WWII? They’d have a room full of people doing a lot of math. That’s like multiprocessing — a bunch of people doing things all at the same time. They may not all be doing the same thing, but they’re all working at the same time.

The contrast is uniprocessing, where you only have ONE person doing something at once.

(2) Multithreading v. Single-threading

Threading is, basically, how many tasks are going on more/less at the same time. You can have multiple things going on either with just one person or with multiple people.

With just one person, that person does some work, gets interrupted to do something else, then switches to a third task, then returns to the first task. For example: Frieda is doing the family taxes, but when the washing machine buzzes, she stops doing the taxes temporarily and goes in to move the wash to the dryer, then returns to the taxes. Or, maybe she decides “I’m going to do my taxes for 30 minutes. Then I’ll call my friend Suzi for 30 minutes. Then I’ll go back to the taxes.”

If you have multiple people working, then you might not need to interrupt Freida. Maybe her husband Larry takes care of the wash or calls Suzi while Frieda does the taxes.

Now, technically, when you’re talking about multithreading in a computer, all of the instructions for doing those things (the taxes, talking to Suzi and swapping the wash) would live inside a single computer program. If they’re in different computer programs, then it’s usually called “multi-process” or “single-process,” but the idea is basically the same.

You are viewing 1 out of 17 answers, click here to view all answers.