baidu / sofa-pbrpc

A light-weight RPC implement of google protobuf RPC framework.
Other
2.13k stars 655 forks source link

底层网络库为什么要用指明epoll呢? #206

Closed kcwl closed 6 years ago

kcwl commented 6 years ago

底层网络库为什么要指明epoll呢?为什么不用通用io_service呢?

zd-double commented 6 years ago

@OkamiLiu io_service是asio中的异步事件队列用来做异步事件的分发,asio在linux平台下底层通讯还是使用的epoll+socket,详细实现可以参考下boost下asio的相关实现 :)

LazyPlanet commented 6 years ago

epoll+socket会有什么问题呢?影响性能吗?

LazyPlanet commented 6 years ago

@zd-double 谢谢。

kcwl commented 6 years ago

@LazyPlanet 影响跨平台扩展

LazyPlanet commented 6 years ago

还有我发现作者一直没有使用io_srevice.run() 这个执行而是使用的io_service_work来包装io_service是不是也是出于性能的考虑?谢谢。