2 ms·
See the very first example of "channels" in that 2009 version: "In the previous section we launched a sort in the background. A channel can allow the launching
by Animats 11y ago
See the very first example of "channels" in that 2009 version:
"In the previous section we launched a sort in the background. A channel can allow the launching goroutine to wait for the sort to complete." ...
c <- 1; // Send a signal; value does not matter.
That's using a channel as a lock on shared data. Not seeing that in the new book. This is a step forward.
(What Go really needs is Rust's borrow checker and move semantics, so that when you communicate on a channel, the compiler checks that you're not sharing too much.)