From owner-freebsd-java@FreeBSD.ORG Thu Aug 23 19:57:28 2007 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF48916A417 for ; Thu, 23 Aug 2007 19:57:28 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.187]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4B013C442 for ; Thu, 23 Aug 2007 19:57:28 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: by fk-out-0910.google.com with SMTP id b27so607686fka for ; Thu, 23 Aug 2007 12:57:27 -0700 (PDT) Received: by 10.82.158.12 with SMTP id g12mr4852981bue.1187899046923; Thu, 23 Aug 2007 12:57:26 -0700 (PDT) Received: by 10.82.162.16 with HTTP; Thu, 23 Aug 2007 12:57:26 -0700 (PDT) Message-ID: Date: Thu, 23 Aug 2007 21:57:26 +0200 From: "Vlad GALU" To: "Nick Johnson" In-Reply-To: <20070823114932.C82369@turing> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070823111051.N82369@turing> <20070823114932.C82369@turing> Cc: freebsd-java@freebsd.org Subject: Re: making nio use kevent/kqueue X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2007 19:57:28 -0000 On 8/23/07, Nick Johnson wrote: > Looking at it a bit more, it looks like the "right" thing to do is to > create a KeventArrayWrapper, possibly based on the EPollArrayWrapper.c so > that multiple ready FDs can be returned at one time. > > That means creating a KeventArrayWrapper.java based on > j2se/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java as well as a > KeventSelectorImpl.java based on EPollSelectorImpl.java and > KeventSelectorProvider.java based on EPollSelectorProvider.java. > > It also means modifying > src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java to select the > KeventSelectorProvider and possibly tweaking some makefiles to ensure that > everything gets built, including: > > make/java/nio/Makefile > make/java/nio/mapfile* (do we end up using mapfile-linux or > mapfile-solaris?) > > Nick > > On Thu, 23 Aug 2007, Nick Johnson wrote: > > > I think there could be a considerable performance gain if java.nio were > > tweaked to use kevent/kqueue(2) as opposed to poll(2). > > > > It looks like the files that would need to be touched for this are: > > > > j2se/src/solaris/native/sun/nio/ch/ > > DevPollArrayWrapper.c (not sure about this one actually since > > FreeBSD doesn't use /dev/poll) > > PollArrayWrapper.c > > SocketChannelImpl.c > > > > Does that sound about right? I see select(2) and poll(2) used in other > > places as well, though outside of nio where they're likely to show the > > greatest benefit. > > > > Are there any caveats or "gotchas" I should be aware if should I decide to > > take some free time to try to come up with a kevent patch for nio? > > > > Also, is there a quicker way to build a JVM when just changing a file or > > two like this? It would be lousy to have to wait 2 hours to build after > > every minor change... IIRC, the OS-X Java uses kqueue already. Furthermore, classpath (http://www.gnu.org/software/classpath/) supposedly has a kqueue nio implementation. I haven't tried any of the two aforementioned solutions, but it's definitely something I'll want to take a look at in the near future. HTH :) > > > > Nick > > > > > > -- > "Courage isn't just a matter of not being frightened, you know. It's being > afraid and doing what you have to do anyway." > Doctor Who - Planet of the Daleks > This message has been brought to you by Nick Johnson 2.3b1 and the number 6. > http://healerNick.com/ http://morons.org/ http://spatula.net/ > _______________________________________________ > freebsd-java@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-java > To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org" > -- If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it.