You have listed events that may wake up in the epic, so the question really becomes: "How to reduce the template for a stunt with your own pipe?"
The answer to this question really depends on your code, language, and what you are trying to do. I assume that you have a stream that handles I / O, and you want to do other work on that stream until there is no I / O. In the code that controls the epoll loop, it can have an internal descriptor that is exposed to other parts of the system, like the wake-up function or the send job function.
There are libraries that do this, such as boost.asio for C ++. However, itβs easy to write your own if you are just targeting epoll, and the amount of actual template code should be minimal if you have a class / module / anything related to the epoll loop.
janm
source share