What’s the difference between multiprocessing and multithreading?

328 views

What’s the difference between multiprocessing and multithreading?

In: 194

17 Answers

Anonymous 0 Comments

Multithreading — Your processing is divided into multiple tasks called threads. The tasks might be worked on by a single processor taking turns doing one task and then another, or they might be worked on by any number of multiple processors.

Multiprocessing — You have more than one processor, each one capable of working on tasks.

Big programs need both to benefit. If you have a multi-processor system but haven’t divided up your work it doesn’t matter if you have 4, 8, or even 64 CPU cores to work on it because the program only has a single task thread to work on so only one of those cores will be used. On the flip side if you have a single processing CPU (rare these days) the overhead of switching between threads is a cost but there’s still only one worker to do the work. To get a good advantage you need both hardware that has multiprocessing ability and you need programs designed to work with multiple, parallel tasks.

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