- الحصول على الرابط
- X
- بريد إلكتروني
- التطبيقات الأخرى
- الحصول على الرابط
- X
- بريد إلكتروني
- التطبيقات الأخرى
Parallel execution is when two programs execute at the same time, exactly the same time. So then, you can say these two programs are executing in parallel.
So, at some particular time, any particular instant in time, you can say there's an instruction from one executing and an instruction from the other executing at the same moment then they are executing in parallel.
Now, generally, processor cores are made to execute one instruction at a time.
But generally, one core runs one thing at a time, one instruction at a time. So, if you want to have actual parallel execution, two things running at the same time, you need two processors or at least two processor cores.
You need replicated hardware. You would need to have one CPU and another CPU 2.
So, for instance, you have two completely separate computers, they can clearly run two different programs at the same time, or they can be the same computer but maybe some multi-core processors got four cores, then you could run four different instructions at the same time, one on each core.
But understand that in order to get actual parallel execution, you need multiple versions of the hardware. You need replicated hardware in order to get parallel execution. Now, this is not the same as concurrency.
So, why should you do parallel execution? What's good about it ?
The best thing about it is the tasks can complete more quickly. Now, by this I mean, a particular task doesn't complete more quickly just because you're running it in parallel with another task, but you get better throughput.
All the tasks are completed more quickly if you're doing two things instead of one at a time or multiple.
All the tasks are completed more quickly if you're doing two things instead of one at a time or multiple.
So, parallel execution can speed things up, give you a better throughput overall.
Parallel execution is not this catch-all that makes everything faster. Certain things can't be executed in parallel. They have to be executed sequentially one at a time.
Some tasks cannot be parallelized even with multi-core hardware, and that's important to know because people often think.
That is not true, Some things cannot be parallelized It's just the nature of the computation.
- الحصول على الرابط
- X
- بريد إلكتروني
- التطبيقات الأخرى
تعليقات
إرسال تعليق