7 Communication using message passing
This chapter covers
- Exchanging messages for thread communication
- Adopting Go’s channels for message passing
- Collecting asynchronous results using channels
- Building our own channels
So far, we have talked about having our goroutines solve problems by sharing memory and using synchronization controls to prevent them from stepping over each other. Message passing is another way to enable inter-thread communication (ITC), which is when goroutines send messages to or wait for messages from other goroutines.
In this chapter, we will explore using Go’s channels to send and receive messages among our goroutines. This chapter will serve as an introduction to programming concurrency using an abstraction that takes ...
Get Learn Concurrent Programming with Go now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.