Chapter 9. Concurrency Patterns - Barrier, Future, and Pipeline Design Patterns

Now that we are familiar with the concepts of concurrency and parallelism, and we have understood how to achieve them by using Go's concurrency primitives, we can see some patterns regarding concurrent work and parallel execution. In this chapter we'll see the following patterns:

  • Barrier is a very common pattern, especially when we have to wait for more than one response from different Goroutines before letting the program continue
  • Future pattern allows us to write an algorithm that will be executed eventually in time (or not) by the same Goroutine or a different one
  • Pipeline is a powerful pattern to build complex synchronous flows of Goroutines that are connected with ...

Get Go Design Patterns now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.