-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c04/c04_10 #46
Comments
一个发送者,N 个接收者 |
N个发送者 1一个接收者 感觉第一段select 检查提前退出这部分代码无用啊,不知道是不是我理解有问题 |
N个发送者 多个接收者代码部分 我个人感觉非缓存的媒介通道也可以实现这个效果啊 |
作者这里没提及一个select的重点,select当多个case可以执行时,并不是像其他语言一样,选择代码中相对靠上的case执行,而是随机执行,所以,如果没有第一段的select,第二段的select可能在极端情况下,始终执行业务channel的case,导致协程无法退出 |
现在的话,是否可以用context来替代 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
4.10 学习 Go 协程:万能的通道模型(公式) — Go编程时光 1.0.0 documentation
https://golang.iswbm.com/c04/c04_10.html
The text was updated successfully, but these errors were encountered: