Exercises
- Read carefully the documentation page of the
sync
package that can be found at https://golang.org/pkg/sync/. - Try to implement
dWC.go
using a different shared memory technique than the one used in this chapter. - Implement a
struct
data 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.RWMutex
and another one that usessync.Mutex
. - What would happen to
mutexRW.go
if you usedLock()
andUnlock()
everywhere instead ofRLock()
andRUnlock()
? - Try to implement
traverse.go
from Chapter 5,Files and Directories using goroutines. - Try to create an implementation of
improvedFind.go
from Chapter 5,Files and Directories using goroutines.