From owner-freebsd-java Fri Aug 25 0:59:31 2000 Delivered-To: freebsd-java@freebsd.org Received: from ares.trc.adelaide.edu.au (ares.trc.adelaide.edu.au [129.127.246.5]) by hub.freebsd.org (Postfix) with ESMTP id 0200237B424 for ; Fri, 25 Aug 2000 00:59:28 -0700 (PDT) Received: (from glewis@localhost) by ares.trc.adelaide.edu.au (8.9.3/8.9.3) id RAA66351; Fri, 25 Aug 2000 17:29:11 +0930 (CST) (envelope-from glewis) From: Greg Lewis Message-Id: <200008250759.RAA66351@ares.trc.adelaide.edu.au> Subject: Re: Solved: JDK 2 Patchset 10 + FreeBSD_CommAPI In-Reply-To: <00da01c00db3$9261bd80$0e05a8c0@intranet.syncrontech.com> from Ari Suutari at "Aug 24, 2000 01:10:46 pm" To: Ari Suutari Date: Fri, 25 Aug 2000 17:29:11 +0930 (CST) Cc: freebsd-java@freebsd.org X-Mailer: ELM [version 2.4ME+ PL70 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Ari Suutari wrote: > Hi again (I feel like talking to myself already....) No, we're all listening :). > Just got things working with patchset 10. The problem is that > FreeBSD_CommAPI uses select(2), which is no longer overrided > by green threads package. The select support of green threads > is behind #ifdef USE_SELECT (see > src/freebsd/hpi/green_threads/src/iomgr.c), > which seems to defined by Makefiles only if FreeBSD version is old > enough (there seems to be a condition for it in Defs-freebsd.gmk). Yes, select() is used with FreeBSD 2.2 and poll() is used for later versions. The original Solaris code itself just uses poll(). The select() wrapper was introduced by the ports team during the port of 1.1.8 and has carried over. I understand that 2.2 either doesn't have a poll() implementation or the implementation isn't quite right. > So I came up with two different solutions: > > 1) Modify CommAPI so that it uses poll instead of select. I have done > this and tested it and it seems to work OK. > > 2) Modify JDK for next patchset so that a wrapper for select is > provided by green threads. Maybe this would be a good thing, > since there may be other JNI code out in the world which relies > on select and omission for wrapper causes such code to fail. Right. That makes some sense. Currently the wrapper is excluded for FreeBSD 3.x and higher since select() isn't being used in the core parts of the code anymore. Maybe we need to include the wrapper whether select() is used there or not. Good sleuth work btw :). -- Greg Lewis glewis@trc.adelaide.edu.au Computing Officer +61 8 8303 5083 Teletraffic Research Centre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message