sogou/workflow

关于异步写操作的实现以及poller的几个操作

zhouchunliang opened this issue · 3 comments

咨询一下,在wget wget_to_redis http_echo_server等tutorial测试中发现,向对等方发送消息均是通过Communicator::send_message_sync中的writev(entry->sockfd, vectors, cnt <= IOV_MAX ? cnt : IOV_MAX)来实现,那epoll.c中的__poller_handle_write的功能是?向对方发送消息时为何不用这个epoll.c中__poller_handle_write?__poller_handle_event和__poller_handle_notify具体的应用场景是什么那?(可以基于具体的场景或者业务谈一下设计时的考虑)
image
image

消息一次发得出去,就不走异步写了啊。这样子快。你试个大一点的消息,就会进poller了。

event其实是linux的eventfd。notify那个你忽略吧,只有mac下的异步文件IO才使用到的。

多谢