...

/

Shared Memory and Shared Variables

Shared Memory and Shared Variables

Let’s learn about shared memory, shared variables, and synchronization.

Mutex variable

Shared memory and shared variables are huge topics in concurrent programming and the most common ways for UNIX threads to communicate with each other. The same principles apply to Go and goroutines, which is what this lesson is about. A mutex variable, which is an abbreviation of mutual exclusion variable, is mainly used for thread synchronization and for protecting shared data ...