From owner-freebsd-java@FreeBSD.ORG Tue Apr 1 10:37:33 2003 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A695D37B401 for ; Tue, 1 Apr 2003 10:37:33 -0800 (PST) Received: from misery.sdf.com (misery.sdf.com [207.200.153.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10E8243F3F for ; Tue, 1 Apr 2003 10:37:32 -0800 (PST) (envelope-from tom@sdf.com) Received: from tom (helo=localhost) by misery.sdf.com with local-esmtp (Exim 2.12 #1) id 190P7y-00006h-00; Tue, 1 Apr 2003 09:00:50 -0800 Date: Tue, 1 Apr 2003 09:00:48 -0800 (PST) From: Tom Samplonius To: Thorsten Mauch In-Reply-To: <002501c2f841$86e3e480$9001000a@thorsten4> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-java@freebsd.org Subject: Re: Is FreeBSD the right platfrom for JBOSS ? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2003 18:37:33 -0000 On Tue, 1 Apr 2003, Thorsten Mauch wrote: > Hi all > I suffer a lot from the absence of native java threads in Linux. My ... I think it is important to define what "native" is. Sun defines "native" threads as implemented by the OS, rather than in the "green threads" library. In this definition, all the Linux jdk's use native threads. You can run "java -version" to see what you are using. However, Linux threads are implemented as pseudo-processes. This limits scalability somewhat, as threads are supposed to be very light-weight. Context switches take longer, and each thread requires considerable base memory. FreeBSD threads are implemented in-process with the pthread library. These processes are quite lightweight. The jdk1.3.1 and jdk1.4.1 ports now use native FreeBSD threads, rather than green threads. But pthread threads only use a single processor. There is a perception that native OS threads are always faster than green threads or some other internally implemented thread system. That isn't always the case. For intstance, Weblogic built their own JVM (JRockit) and they purposesly implemented their own thread system that does not use OS threads at all. They claim that their JVM is faster for hosting server apps than any other JVM. Tom