-
Notifications
You must be signed in to change notification settings - Fork 935
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
improve fiber_io_loop #279
Comments
之所以没将将超时设为-1,就是防止没有句柄被监听的情况。另外,该超时值还会被动态地修改,比如在 hooked poll中。 |
是的, 一共有两个超时判定 分层来看 整体来看 你所说的动态修改是指ev->timeout吧, 看到poll和fiber delay会改它 |
还需要拿一些例子去验证一下,另外,acl_fiber_nready 函数中需要把所有准备好的协程都得要包含进去。 |
unsigned acl_fiber_nready(void) {
if (__thread_fiber == NULL) {
return 0;
}
return (unsigned) ring_size(&__thread_fiber->ready);
} 是根据ndead仿照的, 是否有遗漏的情况呢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
鉴于之前timer变量未更新的问题, 研究了一下io loop逻辑
发现即使需要更久的io超时, 也会把它限制在100毫秒以内
去掉此限制后, 程序却不会正常退出, 因为最后一个fiber无io无timer却会执行event_process且无期限(timeout == -1)
所以loop逻辑不够完善, 遂重写了一遍
添加了
acl_fiber_nready
函数 (所以之前fiber从创建到被调度是有额外延时的?)重写之后会做最合适的超时判定, 不会再被无意义的唤醒, 减少了冗余代码
没有提PR的原因是刚写好, 尚未经过一定时间的验证, 也想请作者review一下
The text was updated successfully, but these errors were encountered: