Any reason why select() uses only level-triggered notification mode?

Misha Dmitriev (Миша) dmitriev at google.com
Fri Dec 19 16:19:22 PST 2008


Hi nio-dev,

I've just recently started to work with NIO, and soon discovered that
Selector.select(), when it uses Unix epoll() call, is hardcoded to use
it in level-triggered mode only. This creates a difficulty if for
better parallelization I want to call select() in one thread, but
handle the received event in other thread, while the first thread
calls select() again. In that case, if additional measures aren't
taken, select() will keep returning the same event for the same
channel until it's actually processed. If select() called epoll in
edge-triggered mode, that won't happen.

I wonder if there are any fundamental reasons for not giving an option
to use edge-triggered mode in Selector.select(). Or, if there are no
such reasons, if there is any chance that this will be implemented in
some future JDK version.

Please reply directly to me, as I am not yet subscribed to this list.

Regards,

Misha



More information about the nio-dev mailing list