Is there an equivalent of Linux epoll in Java?
epoll allows a thread to react to a number of heterogenous events. For instance, I can have a thread that reacts to e
Yes, the nio package allows the use of Selectors which supply the functionality equivalent of poll()/select() and actually one of the implementations uses epoll as the backend (this is selected via java.nio.channels.spi.SelectorProvider Java property). Selectors are usually used with network sockets, but if you look through the different Channel implementations in the docs, I think it's likely you will be able to use this mechanism with standard input as well (there are helper classes which allow moving between old Stream-based APIs and the nio APIs to some degree).