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
分享
返回顶部
顶部