ZLToolKit icon indicating copy to clipboard operation
ZLToolKit copied to clipboard

Discussion about the poller thread

Open Nic-bit opened this issue 10 months ago • 0 comments

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

Nic-bit avatar Mar 25 '24 03:03 Nic-bit