Synchronization with sync and atomic

This chapter will continue the journey into Go concurrency, introducing the sync and atomic packages, which are a couple of other tools designed for orchestrating synchronization between goroutines. This will make it possible to write elegant and simple code that allows concurrent usage of resources and manages a goroutine's lifetime. sync contains high-level synchronization primitives, while atomic contains low-level ones.

The following topics will be covered in this chapter: