Golang Concurrency #8 - Mutexes
Introduction
Mutexes solve the problem: "What happens when multiple goroutines access the same variable?"
The Problem: Race Condition
var counter int
func main() {
for i := 0; i < 1000; i++ {
go func() {
counter++ // Multipl...
tigerabrodi.blog2 min read