liveBook · Manning

Parallelism

As explained in Rust in Action: Systems programming concepts and techniques

Parallelism is the simultaneous execution of computational activities on multiple physical processing cores or other execution units.

Parallelism means multiple threads execute at the same time on multiple physical CPU cores. It is more specific than concurrency, which means multiple tasks can make progress over the same period without necessarily using multiple cores. section 10.0 section 10.5

One core or several?

On one core, a thread waiting for memory or I/O can be blocked while another task runs. The tasks are concurrent, but they are not running on separate cores at the same time. Threads executing simultaneously on multiple cores are parallel. section 10.0 section 10.5

A thread of execution is a sequence of instructions intended to run in order. Running several threads concurrently does not, by itself, establish that their instructions execute in parallel; the number of cores in use matters. section 10.5

How Rust in Action: Systems programming concepts and techniques covers it

How deep it goes
Defines parallelism and contrasts it with blocked-thread scheduling, without developing an implementation of concurrency libraries.
Examples
Compares threads taking turns during memory or I/O waits on one core with threads executing on multiple CPUs.
What it assumes
Builds from the familiar idea of a program while introducing threads and processes as new vocabulary.
What you can do after
Evaluate/understand whether concurrent tasks also execute in parallel on multiple CPU cores.
How it connects
Connects parallelism to threads, concurrency, CPU cores, and task scheduling.

Also explained in

Compare how 38 books explain parallelism →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust in Action: Systems programming concepts and techniques. The section links point to the parts of the book it draws on.