ZLMediaKit / ZLToolKit

一个基于C++11的轻量级网络框架,基于线程池技术可以实现大并发网络IO
MIT License
1.94k stars 581 forks source link

Discussion about the poller thread #221

Open Nic-bit opened 6 months ago

Nic-bit commented 6 months ago

What do you think about using a coroutine pool to handle the event tasks listened by epoll in the poller thread? Would this improve performance? Is there a big difference between one thread handling multiple tasks and starting several coroutines in a thread to handle tasks? For example, in network communication, the tasks handled by the poller thread are mostly IO tasks. If they are replaced with coroutines, performance should improve somewhat. Can the author give some suggestions? Thanks.

作者你觉得在poller线程中,使用一个协程池来处理epoll监听的事件任务怎么样,这样对性能提升有效吗?一个线程处理多个任务,跟在线程中起几个协程来处理任务差别大吗,像网络通信中,poller线程处理的任务大多是IO任务,如果换成协程,性能应该有些提升。作者可以给些建议吗?感谢

TRANS_BY_GITHUB_AI_ASSISTANT