Go sync 101

Walk through Mutex and other sync tools

Stefanie Lai
Dev Genius
Published in
8 min readMay 10, 2022

--

In Go 1.18, generics, which catches most of the eyes, is considered the biggest syntax “evolution” since the advent of Go. But, other changes to API, which don’t draw so much attention, should not be ignored, such as TryLock being added to the Mutex and RWMutex APIs of the sync package.

While reading the sync documentation, I found myself new to it, even to the Mutex or WaitGroup, which motivated me to chew over Go sync, and review the definitions of its different types and the functions it contains.

--

--