 |
| A single-core machine multithreading is much like a good juggler: you may only be doing one thing at once, but you have to be really good at switching between balls or you’ll drop one! Image courtesy of Guillaume Riesen |
Until recently, most computers had a single processor (CPU) which contained a single core. Computers could execute only one task at a time.
Then multi-threading came along. top500’s glossary of terms describes multithreading as:
A capability of a processor core to switch to another processing thread, i.e., a set of logically connected instructions that make up a (part of) a process. This capability is used when a process thread stalls, for instance because necessary data are not yet available. Switching to another thread that has instructions that can be executed will yield a better processing utilisation.
Not all CPUs can do multithreading, and not all applications follow the multithreading programming model. Both must be true for the multithreading to occur.
Multithreading is not parallel processing. The core is still only able to run one thread at a time.
On the other hand, a multithreaded program or algorithm that is run on a cluster, grid, supercomputer, or multi-core system will run in parallel.
Multiprocessing and multithreading on a many-core system are not the same thing either. A process is made up of many threads. As an analogy, consider a tasty four-course meal. A multiprocessing algorithm for cooking the meal would look kind of like a potluck – each attendee (processor) would cook one course (process), and then bring them together at dinner time. A multithreading algorithm for cooking the meal would look more like four people in the same kitchen, cooking the meal as a team. Each cook (processor) would end up working a little bit on each course (process).
A lot of software commonly used in scientific contexts is now incorporating multithreading and multiprocessing capabilities. Now you know how to tell the difference between the two, so that you can make informed decisions about what software to choose.
With reference to: Thread (computer science), Wikipedia (with special reference to Section 2 ) Multithreading, Wikipedia Multiprocessing, WordNet
-Miriam Boon, iSGTW
|