// access to shared memory among threads // controlled using locks. Problem is that the programmer // is then responsible to locking and unlocking. // // The basic idea here is to start a bunch of thread and // have them all increment a single variable // // Author: gtowell // Created: August 2022 package main import ( "fmt" "sync" ) var ( mu sync.Mutex counter int64 ) func main() { var wg sync.WaitGroup threads:= 100 times := 1000000 for rz:=0; rz