3 Thread communication using memory sharing
This chapter covers
- Using inter-thread communication with our hardware architecture
- Communicating with memory sharing
- Recognizing race conditions
Threads of execution working together to solve a common problem require some form of communication. This is what is known as inter-thread communication (ITC), or inter-process communication (IPC) when referring to processes. This type of communication falls under two main classes: memory sharing and message passing. In this chapter, we will focus on the former.
Memory sharing is similar to having all our executions share a large, empty canvas (the process’s memory) on which each execution gets to write the results of its own computation. We can coordinate ...
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.