From owner-freebsd-java Wed Dec 12 8:40:50 2001 Delivered-To: freebsd-java@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 1461137B417 for ; Wed, 12 Dec 2001 08:40:25 -0800 (PST) Received: from caddis.yogotech.com (yogotech.nokia.com [4.22.66.156]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id JAA28417; Wed, 12 Dec 2001 09:40:21 -0700 (MST) (envelope-from nate@yogotech.com) Received: (from nate@localhost) by caddis.yogotech.com (8.11.6/8.11.6) id fBCGeFc06104; Wed, 12 Dec 2001 09:40:15 -0700 (MST) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15383.34926.828024.362022@caddis.yogotech.com> Date: Wed, 12 Dec 2001 09:40:14 -0700 To: shudo@computer.org Cc: freebsd-java@FreeBSD.ORG Subject: Re: Native, kernel and user-space threads In-Reply-To: <20011212095914G.shudoh@aist.go.jp> References: <20011212095914G.shudoh@aist.go.jp> X-Mailer: VM 6.96 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > I wanna be convinced of the meaning of `native' threads. > > Currently, FreeBSD (release and stable) does not have a > threading mechanism implemented in kernel space. I > suppose native threads you refer is a threads library > which have POSIX threads API and implemented in user > space. Is this true? Correct. > If so, the present difference between native threads and > green threads seems to be their own APIs. Again, you are correctly diagnosing the situation. > Both of them > are user-space threading libraries. Migration to the > POSIX interface is worth much to support forthcoming > Java 2 SDK 1.4. But, what are real present merits of > native threads without kernel threading for JDK users? Because the POSIX (pthreads) interface is used by additional software such as HotSpot. Performance for both should be equal, although I suspect the green threads port may be less buggy/more stable than the pthreads port in the short term since it's had more time to have all it's bug worked out. > I have been satisfied by green threads implementations > on Linux and FreeBSD while developing a JIT compiler for > them over three years. It performs faster than Linux > (kernel) threads with many applications because it is > implemented in user space. I do not have SMP machines :) This is the case for many applications. However, a good kernel threads implementation (not the one in Linux) should do a good job of keeping as many threads runnable as possible. This is the intent of the FreeBSD kernel threads implementation. Solaris kernel threads do a fairly good job of balancing out performance such that applications works fairly well in both green and kernel threads environment, and in those cases where kernel threads are a win, the default of using kernel threads provides a big win. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message