Epoll on regular files

Not really. epoll only makes sense for file descriptors which would normally exhibit blocking behavior on read/write, like pipes and sockets. Normal file descriptors will always either return a result or end-of-file more or less immediately, so epoll wouldn’t do anything useful for them.

What’s the difference between event-driven and asynchronous? Between epoll and AIO?

Events is one of the paradigms to achieve asynchronous execution. But not all asynchronous systems use events. That is about semantic meaning of these two – one is super-entity of another. epoll and aio use different metaphors: epoll is a blocking operation (epoll_wait()) – you block the thread until some event happens and then you … Read more

select vs poll vs epoll [closed]

The answer is epoll if you’re using Linux, kqueue if you’re using FreeBSD or Mac OS X, and i/o completion ports if you’re on Windows. Some additional things you’ll (almost certainly) want to research are: Load balancing techniques Multi-threaded networking Database architecture Perfect hash tables Additionally, it is important to note that UDP does not … Read more

Why is epoll faster than select?

There’s a lot of misinformation about this, but the real reason is this: A typical server might be dealing with, say, 200 connections. It will service every connection that needs to have data written or read and then it will need to wait until there’s more work to do. While it’s waiting, it needs to … Read more

What’s the difference between epoll, poll, threadpool?

Threadpool does not really fit into the same category as poll and epoll, so I will assume you are referring to threadpool as in “threadpool to handle many connections with one thread per connection”. Pros and cons threadpool Reasonably efficient for small and medium concurrency, can even outperform other techniques. Makes use of multiple cores. … Read more