by andreareina · 9y ago · 0 comments
How does this prevent data races if more than one goroutine holds a pointer to the shard structure and they're running concurrently?
Under the channels model, you wouldn't want more than one goroutine to be accessing the shared structure. One routine would hold the reference to the resource, and other routines talk with the first routine via channels (i.e. share memory by communicating).