Deviopath › Go

Safe Counter

Hard · Concurrency

Without a mutex, n++ from several goroutines races. Protect the increment with sync.Mutex.

Write Add and Value on Counter. RunCounter(goroutines, each) is already written and adds each times from each goroutine.

Next: Stage Pipeline