Replies: 4 comments
-
|
类似这样 // thread 2 |
Beta Was this translation helpful? Give feedback.
-
|
按照 muduo 的设计,epoll_wait() 和操作 listen_fd 会在同一个线程,不会出现跨线程添加事件的情况。 |
Beta Was this translation helpful? Give feedback.
-
|
muduo设计的时候,不进行跨线程添加事情是什么考虑吗? 个人理解: |
Beta Was this translation helpful? Give feedback.
-
|
muduo 的设计是一个 socket 只属于一个 event loop,这个 socket 上的所有 IO 操作(包括回调用户 handler 和调用 epoll_ctl)都只会在其所属的 event loop 内发生,这样编程模型比较简单易懂。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
对于新连接TcpConnectPtr往epoll中添加需要关注的事件时需要wakeup唤醒当前EventLoop线程吗,直接调用epoll_ctl添加应该就可以吧
Beta Was this translation helpful? Give feedback.
All reactions