Exercises
- Read carefully the documentation page of the
syncpackage that can be found at https://golang.org/pkg/sync/. - Try to implement
dWC.gousing a different shared memory technique than the one used in this chapter. - Implement a
structdata type that holds your account balance and make functions that read the amount of money you have and make changes to the money. Create an implementation that usessync.RWMutexand another one that usessync.Mutex. - What would happen to
mutexRW.goif you usedLock()andUnlock()everywhere instead ofRLock()andRUnlock()? - Try to implement
traverse.gofrom Chapter 5,Files and Directories using goroutines. - Try to create an implementation of
improvedFind.gofrom Chapter 5,Files and Directories using goroutines.