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
提示:哪一章节的问题,建议如何修改
携程和线程的区别就在于协程重做了上下文切换,减少了内核态和用户态的交互。
而不是每个系统级的线程都会有一个固定大小的栈,一个进程中所有的线程和携程的堆栈空间都是共享的。
The text was updated successfully, but these errors were encountered:
协程的栈和传统的线程栈都不是一回事的呀
Sorry, something went wrong.
那只要你开辟或者复制内存了,性能就绝对不会高 @cch123 ,而且携程的栈指的应该是函数栈,堆也是,存的都是类似的局部变量。协程和线程最大的区别就在于上下文切换上做了优化,如果还需要开辟额外的空间,那么大概率不会比线程快的
Goroutine和线程的本质区别:Go编译器认识Goroutine的Go语法,可以开很多优化后门;而OS不认识写线程的编程语言,只能采用保守策略。
No branches or pull requests
提示:哪一章节的问题,建议如何修改
携程和线程的区别就在于协程重做了上下文切换,减少了内核态和用户态的交互。
而不是每个系统级的线程都会有一个固定大小的栈,一个进程中所有的线程和携程的堆栈空间都是共享的。
The text was updated successfully, but these errors were encountered: