March 2019
Beginner to intermediate
324 pages
7h 17m
English
An important question can now be addressed; what if we need to share a piece of data between two different goroutines?
In programs that make use of multiple threads, the common approach to share data between different threads is to lock the variables that are shared between the threads. This is typically known as the sharing memory approach. The following diagram demonstrates how two threads will share memory, by sharing a variable called X:

In Go, there is a very popular motto:
What does that mean? It simply means that Go does not typically prefer ...
Read now
Unlock full access