From owner-freebsd-java@FreeBSD.ORG Sat Jan 30 17:57:10 2010 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 65014106566C for ; Sat, 30 Jan 2010 17:57:10 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from mx.utwente.nl (mx3.utsp.utwente.nl [130.89.2.14]) by mx1.freebsd.org (Postfix) with ESMTP id DBF198FC21 for ; Sat, 30 Jan 2010 17:57:09 +0000 (UTC) Received: from nox.student.utwente.nl (nox.student.utwente.nl [130.89.165.91]) by mx.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id o0UHGHHH014429 for ; Sat, 30 Jan 2010 18:16:17 +0100 From: Pieter de Goeje To: freebsd-java@freebsd.org Date: Sat, 30 Jan 2010 18:16:16 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201001301816.16987.pieter@degoeje.nl> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact icts.servicedesk@utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pieter@degoeje.nl X-Spam-Status: No Subject: OpenJDK 6/7 kqueue based NIO provider 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: Sat, 30 Jan 2010 17:57:10 -0000 Hi, I'm looking for a kqueue based implementation of java.nio.Selector. If it doesn't exit yet, I'll have to create it myself. I've already looked at the code for the EPoll provider and it doesn't seem too hard to create a kqueue based one. I will have to figure out how to interface with native libraries though. The reason is obviously performance. I created a simple nio based echo server and a kqueue client in C, which creates about 50K simultaneous connections. Java is completely CPU bound and can only reply to about 100 connections per second due to immense poll(2) overhead, and it takes ages for all 50K connections to be accepted by the server. Input welcome :-) -- Pieter