3 ms·
I like using poll(). I don't generally write software which waits for tens of thousands of FDs, I wait for a couple. Sacrificing platform support for more or le
by mort96 3y ago
I like using poll(). I don't generally write software which waits for tens of thousands of FDs, I wait for a couple. Sacrificing platform support for more or less nothing in return doesn't make a lot of sense.
Kqueue/kevent/epoll are good options if you have very particular needs, such as a huge number of file descriptors, but I'd argue poll() should be the go-to.
- arghwhat 3y agoYou get kqueue and epoll for free with most small event loop libraries. But yes, where you only need to poll a few things, poll(3) is fine.
- mort96 3y agoI guess if you're using an event loop library you don't have to think about it. For people who make event loop libraries, I agree that they should probably support kqueue/kevent+epoll. I was talking about normal application code that's not using such an event loop library.