Computer Science, asked by navaraja5896, 1 year ago

Difference between parallel processing and pipeline processing

Answers

Answered by rkburman72
0

Multiprocessing is a proper subset of parallel computing. Parallel computing means that more than one thing is calculated at once. Yes, using multiple processors, or multiprocessing, is a subset of that. Another example is a GPU. A GPU can calculate the pixels for the screen in parallel, but there is only one GPU doing it. It’s not multi-processing, but it is parallel computing.


There is no pro and con for them. They are just different approaches, different tools, to similar but different problems. You can have multiple processors drawing a screen full of information, but most of the hardware that make a CPU general will be wasted. Similarly, you can make a GPU act like a single CPU, but you’ll waste almost all of the capability of the GPU. That is because the hardware for each are designed to do different things.


Specifically for the CPython implementation but maybe not python the language, parallel computing almost always means multiprocessing. The python language doesn’t have in it semantics for parallel computing by default. It’s not specifically precluded, but it doesn’t have an in-built description. There are no keywords that mean many things are being computed at the same time. There are certainly libraries that bridge the gap.


Forgive me if my understanding is wrong; I don’t follow python closely and it may have been added. Last I heard there was a Global Interpreter Lock (GIL) which precluded multiprocessing within a single program. It was a protection to make sure that changing a variable wasn’t done by two different processors in a way that causes inconsistencies. It also stops multiprocessing within a single program. So when you multiprocess in python, you need to spit into multiple processes (using fork or similar,) or use a library, or both.

Similar questions