wwbmmm commented on issue #2903: URL: https://github.com/apache/brpc/issues/2903#issuecomment-2700642500
> 1. 我明白了,在哪个线程resume,就会在哪个线程执行co_wait之后的逻辑对吧 是的 > 3. FLAGS_event_dispatcher_num决定了会有多少个bthread去epoll_wait IO事件,这些epoll-bthread会被dispatcher调度到不同pthread上。分布在不同pthread上的epoll-bthread会依据外部IO在各自的pthread上生成coroutine处理request,通过这种方式可以实现把coroutine扩展到所有pthread上,我这么理解对吗 是的 > 5. 再确认一件事情,关注到FLAGS_event_dispatcher_num生成的epoll-bthread是被dispatcher随机调度到不同pthread上的,这个可能会导致epoll-bthread的分布不均,而且所有epoll_bthread监控的是同一个epoll_fd,是否会存在惊群问题,如果不同的epoll_bthread监听不同的epoll_fd,然后每个epoll_fd负责不同的连接会不会更好些 epoll-bthread会阻塞所在pthread,所以新增的epoll-bthread只能调度到其他空闲的pthread,最终应该每个epoll-bthread都在不同的pthread上,不会分布不均。然后epoll_fd事件来了之后应该是由操作系统决定唤醒哪个epoll_bthread,一次只选择一个进行唤醒,应该不会有惊群问题 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org