when epoll instead poll ?

Asked by feigao007

1、why not use "usleep" in "loop"?
2、how about use "muti thread" for process.?
3、when use epoll instead poll?

Question information

Language:
English Edit question
Status:
Solved
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Solved by:
feigao007
Solved:
Last query:
Last reply:
Revision history for this message
Roger Light (roger.light) said :
#1

1. You'll have to be more specific.
2. The client library is multithreaded, it's much more complicated for the broker. The single threaded broker can handle 200k clients with QoS 2 and modest message rates: https://lists.launchpad.net/mosquitto-users/msg00107.html
3. epoll is Linux specific whereas poll is available everywhere, so it's extremely unlikely that epoll will ever be supported. I am looking at event loop libraries that abstract out the poll/epoll/kqueue interfaces. Using one of those would allow epoll to be used on Linux.

I hope that helps.

Roger

Revision history for this message
feigao007 (gwwddd) said :
#2

thank you ,usefully ,I will do more test on them.

Revision history for this message
onaips (onaips) said :
#3

I second that. I would go for libevent, its a easy to use library with great multithread support, and you can even leverage the integrated SSL.

Cheers