mirror of https://github.com/F-Stack/f-stack.git
try reduce the number of call ff_linux_epoll_wait().
This commit is contained in:
parent
8ae79cd438
commit
85173ced83
|
@ -1788,13 +1788,17 @@ RETRY:
|
|||
DEBUG_LOG("call ff_linux_epoll_wait at the same time, epfd:%d, fstack_kernel_fd_map[epfd]:%d, kernel_maxevents:%d\n",
|
||||
fd, fstack_kernel_fd_map[fd], kernel_maxevents);
|
||||
if (likely(fstack_kernel_fd_map[fd] > 0)) {
|
||||
kernel_ret = ff_linux_epoll_wait(fstack_kernel_fd_map[fd], events, kernel_maxevents, 0);
|
||||
DEBUG_LOG("ff_linux_epoll_wait kernel_ret:%d, errno:%d\n", ret, errno);
|
||||
if (kernel_ret < 0) {
|
||||
kernel_ret = 0;
|
||||
} else if (kernel_ret > 0) {
|
||||
events += kernel_ret;
|
||||
static uint64_t count = 0;
|
||||
if (unlikely(count & 0xff == 0)) {
|
||||
kernel_ret = ff_linux_epoll_wait(fstack_kernel_fd_map[fd], events, kernel_maxevents, 0);
|
||||
DEBUG_LOG("ff_linux_epoll_wait kernel_ret:%d, errno:%d\n", ret, errno);
|
||||
if (kernel_ret < 0) {
|
||||
kernel_ret = 0;
|
||||
} else if (kernel_ret > 0) {
|
||||
events += kernel_ret;
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue