-
Notifications
You must be signed in to change notification settings - Fork 937
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
socket与fiber是如何结合的? #265
Comments
acl 协程hook了底层的I/O API,所以可以将 socket 的 I/O 过程协程,我曾在 https://mp.weixin.qq.com/s/XAEzZAUYuOhuqMOszNFe2A 文章中介绍过 acl 协程的原理,但还未曾讲过 acl 协程是如何 hook 系统 I/O API 的,将来有时间可以讲讲这块。 |
对,原理是这样的。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
大神新好!
看了acl的源码,对协程的流程基本了解,不太明白的是socket与fiber是如何联接起来的。
像下面的示例代码,fiber_echo这个类是继承了acl::fiber因此可以在fiber->start()的时候运行run()虚函数,但是当conn_->read() 的时候,涉及到socket的读写,如何导致与此fiber暂停,然后在read成功后再继续运行,底层是如何实现的?
有没有相关的文档介绍?
The text was updated successfully, but these errors were encountered: