Parallel Programming
What is Parallel Programming?
Parallel Programming: Where concurrency is about structure, parallelism is about speed: dividing a workload into independent chunks that literally execute simultaneously on multiple cores, then combining the results. Parallel programming splits work into parts that run at exactly the same time on multiple processor cores or machines, then combines the results. The goal is speed.
Frequently asked questions about Parallel Programming
How is Parallel Programming used in practice?
It is related to concurrency but not the same. Concurrency is about structuring a program to handle many things whose lifetimes overlap, even on one core. Parallelism is about actually doing several things simultaneously.
What should you keep in mind with Parallel Programming?
Parallelism works best when the parts are independent: processing separate images, files or batches of records. When parts share data, coordination costs can eat up the gains, as Amdahl's Law describes. In web applications, the everyday form of parallelism is running several queue workers, or splitting a large job into batches that workers process side by side. That is often enough without writing any multi-threaded code yourself.
At a glance
| Category | Programming paradigms |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |