Вопрос

I found this article saying OpenJDK uses epoll on linux, but does anybody know if Selector implementations use kqueue, dev/poll etc over traditional polling where available?

Это было полезно?

Решение

Yes it does. java.nio.channels.Selector.open() returns different implementations depending on your underlying operating system. Eg. If you are using a JRE from sun/oracle you will get:

Windows 
sun.nio.ch.WindowsSelectorImpl

Mac OS 
sun.nio.ch.KQueueSelectorImpl

Linux 
sun.nio.ch.EPollSelectorImpl

Solaris
sun.nio.ch.PollSelectorImpl
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top