We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
select的源码中在被唤醒后,会把在其他channel上等待的都删除。
但是这有一个问题,就是channel如何识别这是第一个select,以及如何在唤醒第一个select后其他的channel碰到此select的不会去唤醒他?
详情可看chan源码,我也在解决这个问题,可惜还是有疑惑
The text was updated successfully, but these errors were encountered:
当有多个 channel ready时,多个 channel 的等待队列在将 g 出队时,会判断该 g 是否通过 select 入队的,如果是,检查 spg.g.selectDone 是否标记为1了,如果是就会跳过,否则就唤醒,对应的代码是 runtime/chan.go: func (q *waitq) dequeue() *sudog {}
Sorry, something went wrong.
No branches or pull requests
select的源码中在被唤醒后,会把在其他channel上等待的都删除。
但是这有一个问题,就是channel如何识别这是第一个select,以及如何在唤醒第一个select后其他的channel碰到此select的不会去唤醒他?
详情可看chan源码,我也在解决这个问题,可惜还是有疑惑
The text was updated successfully, but these errors were encountered: