understanding Golang channel in one word

原创
2012/03/13 22:11
阅读数 21.5W
  1. -- Receivers always block until there is data to receive.

  2. -- If the channel is unbuffered, the sender blocks until the receiver has received the value.

  3. -- If the channel has a buffer, the sender blocks only until the value has been copied to the buffer( wait for copy action); if the buffer is full, this means waiting until some receiver has retrieved a value(just looks like a unbuffered channel).

展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部