From owner-freebsd-java Mon Jul 9 8:12:16 2001 Delivered-To: freebsd-java@freebsd.org Received: from mail.xmission.com (mail.xmission.com [198.60.22.22]) by hub.freebsd.org (Postfix) with ESMTP id 129DA37B403 for ; Mon, 9 Jul 2001 08:12:13 -0700 (PDT) (envelope-from glewis@misty.eyesbeyond.com) Received: from [166.70.6.21] (helo=misty.eyesbeyond.com) by mail.xmission.com with esmtp (Exim 3.12 #1) id 15Jchm-0001Tm-00; Mon, 09 Jul 2001 09:12:11 -0600 Received: (from glewis@localhost) by misty.eyesbeyond.com (8.11.3/8.11.3) id f69FC6o80908; Tue, 10 Jul 2001 00:42:06 +0930 (CST) (envelope-from glewis) Date: Tue, 10 Jul 2001 00:42:06 +0930 From: Greg Lewis To: Ian Jenkinson Cc: freebsd-java@FreeBSD.ORG Subject: Re: Threads in Java on a variety of platforms Message-ID: <20010710004206.A80869@misty.eyesbeyond.com> References: <000201c1086c$433a29e0$0a64a8c0@buxtongw> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <000201c1086c$433a29e0$0a64a8c0@buxtongw>; from ian.jenkinson@blueyonder.co.uk on Mon, Jul 09, 2001 at 12:42:41PM +0100 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 On Mon, Jul 09, 2001 at 12:42:41PM +0100, Ian Jenkinson wrote: > I've a question about thread models employed within a Java JVM. > Can anyone kindly offer a concise discussion on the comparison of the > thread model employed on > Microsoft Windows, Linux, FreeBSD and Solaris? If it's the same model on all > of them, is the model the same > with 'green' and 'native' on the Unix platforms? Hmmm, not sure how concise this will be, but I'll try to give you some idea :). Green threads are essentially the same across all platforms. They are implemented within and managed by the JVM itself. Native threads, however, rely on the underlying thread mechanism that is "native" to the OS. So Linux, for example, uses its clone() based kernel threads which have a pthreads interface. Solaris uses its native thread library. Etc. The FreeBSD JDK port doesn't support native threads at the moment. > Are these two logically the > same at the level of java source that I write, > just different deep within the JVM/how the OS implements it? Well, yes and no. With green threads you should get the same sort of behaviour across the board. With native threads (which is the default on most OSes) behaviour can be somewhat different. For example, when I was learning Java I wrote a program which worked fine under Windows 95 but thrashed the CPU on Windows NT. Why? Different underlying thread priority models. > If this is covered on a URL I'll be happy to read it but the research I've > done so far hasn't lead me to an answer. I would have thought the main Java site has something on this somewhere, but no idea where. HTH. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Mobile: 0419 868 494 Information Technology Web : http://www.eyesbeyond.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message