Grokking Concurrency in Go
0% completed
Channels or Mutexes
Effective Go states the language's approach to concurrency in one sentence, which Go programmers also repeat as a proverb:
"Do not communicate by sharing memory; instead, share memory by communicating."
The first half describes the traditional approach. Several threads read and write the same variables, and locks keep them from interfering. The second half describes the approach Go was designed to encourage. A value is passed from one goroutine to another through a channel, and only the goroutine that currently holds it may touch it.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%