Skip to content
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

007 最后一个问题感觉讲的有问题 #5

Closed
papandadj opened this issue Feb 19, 2019 · 3 comments
Closed

007 最后一个问题感觉讲的有问题 #5

papandadj opened this issue Feb 19, 2019 · 3 comments

Comments

@papandadj
Copy link

在没有函数调用的情况下, for true{}依然会让出执行权。

@lifei6671
Copy link
Owner

你可以测试下。

@LieLieLiekey
Copy link

在没有函数调用的情况下, for true{}依然会让出执行权。

我这里也是让出了,是goroutine版本高的原因吗?

@lifei6671
Copy link
Owner

在没有函数调用的情况下, for true{}依然会让出执行权。

我这里也是让出了,是goroutine版本高的原因吗?

在1.14之前的版本是协作式抢占,之后的版本是信号抢占,协作式抢占需要执行函数。信号抢占不需要,是调度器直接让M挂起执行的G。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants