Date: Mon, 02 Aug 2010 17:27:47 +0800 From: David Xu <davidxu@freebsd.org> To: freebsd-java@freebsd.org Subject: java nio channel selectors can use kqueue/kevent Message-ID: <4C568F93.1070608@freebsd.org>
next in thread | raw e-mail | index | archive | help
I was suprised the java uses poll() on freebsd for its nio, while others are using devpoll() or epoll(). I have spent one week to work out a patch, and let it work with kqueue. I have tried to make it better, but because the java nio selector are poll() centric so something in the patch is not very perfect. Here is the patch: http://people.freebsd.org/~davidxu/patch/jdk16_nio_kqueue.patch just cd into /usr/ports/jdk16, and type following commands: make extract make patch cd work patch < this_patch_file cd .. make install note that the patch does not make kqueue method as default provider, you should specify it on comand line like following: java -Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.KqueueSelectorProvider <application class> Regards, David Xu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C568F93.1070608>