liveBook · Manning

Parallelism

As explained in Go in Action, Second Edition

Parallelism is the simultaneous execution of multiple computational activities, typically on separate processors or cores.

Parallelism executes multiple computational activities simultaneously, typically on separate processors or cores. It differs from concurrency: concurrency manages several tasks at once, while parallelism performs them at the same time. Go supports this style through lightweight goroutines, channels for communication, and runtime-managed scheduling. section 9.0

Use parallelism when independent work can proceed together: CPU-bound computations can use multiple cores, while concurrent I/O work can reduce waiting during network, disk, or database operations. The same approach supports data pipelines, worker pools, background jobs, real-time feeds, device coordination, and responsive interfaces. section 9.6.2 section 9.1

Fetching RSS feeds concurrently

An RSS reader can launch one goroutine per feed instead of fetching sources sequentially. Calling printFeedTitle with the go keyword starts independent work for the New York Times and BBC feeds, allowing network waits to overlap. A production design should coordinate completion rather than rely on an arbitrary sleep. section 9.1

Practical parallelism patterns include:

  • Run independent network, file, or database operations concurrently to reduce idle waiting. section 9.6.2
  • Use worker pools to control parallelism while distributing queued jobs across goroutines. section 9.6.2
  • Pass data between concurrent pipeline stages with channels. section 9.6.2

How Go in Action, Second Edition covers it

How deep it goes
Defines parallelism against concurrency and demonstrates goroutine-based execution, but defers detailed synchronization and completion coordination.
Examples
Uses an RSS reader that fetches New York Times and BBC feeds through separate goroutines.
What it assumes
Distinguishes concurrency from parallelism and assumes enough Go familiarity to define functions, invoke commands, and import packages.
What you can do after
Apply it via Go goroutines, channels, and worker pools to overlap independent work and use multiple CPU cores.
How it connects
Connects parallelism with concurrency, goroutines, channels, worker pools, data pipelines, and blocking I/O.

Also explained in

Compare how 38 books explain parallelism →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Go in Action, Second Edition. The section links point to the parts of the book it draws on.