From owner-freebsd-java Tue Jul 10 4:38:57 2001 Delivered-To: freebsd-java@freebsd.org Received: from ntua.gr (achilles.noc.ntua.gr [147.102.222.210]) by hub.freebsd.org (Postfix) with ESMTP id 0FC6F37B407 for ; Tue, 10 Jul 2001 04:38:53 -0700 (PDT) (envelope-from past@netmode.ntua.gr) Received: from netmode.ntua.gr (dolly.netmode.ece.ntua.gr [147.102.13.10]) by ntua.gr (8.11.4/8.11.4) with ESMTP id f6ABcoY02265; Tue, 10 Jul 2001 14:38:50 +0300 (EET DST) Received: (from past@localhost) by netmode.ntua.gr (8.11.1/8.11.1) id f6ABcoV14922; Tue, 10 Jul 2001 14:38:50 +0300 (EEST) (envelope-from past) Date: Tue, 10 Jul 2001 14:38:50 +0300 From: Panagiotis Astithas To: Greg Lewis Cc: Ian Jenkinson , freebsd-java@FreeBSD.ORG Subject: Re: Threads in Java on a variety of platforms Message-ID: <20010710143850.B12282@netmode.ece.ntua.gr> Reply-To: past@netmode.ntua.gr Mail-Followup-To: Panagiotis Astithas , Greg Lewis , Ian Jenkinson , freebsd-java@FreeBSD.ORG References: <000201c1086c$433a29e0$0a64a8c0@buxtongw> <20010710004206.A80869@misty.eyesbeyond.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20010710004206.A80869@misty.eyesbeyond.com>; from glewis@eyesbeyond.com on Tue, Jul 10, 2001 at 12:42:06AM +0930 X-Organizational-Unit: Network Management and Optimal Design Laboratory X-Organization: National Technical University of Athens, GREECE X-Work-Phone: +30-1-772-1-450 X-Work-FAX: +30-1-772-1-452 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 Tue, Jul 10, 2001 at 12:42:06AM +0930, Greg Lewis wrote: > 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. This is something that has been bugging me for a while: would it be good to implement the native threads in FreeBSD under LinuxThreads or NGPT? I see that KSE's are taking off, but there is a long way ahead. I am thinking of something like a straight port of the Linux JDK native threads. Have you contemplated this in your 1.3 porting efforts, or did you stick to green threads? > > 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. The moto IIRC is "don't rely on thread priorities for your application's logic, if you want to be cross-platform". > > 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. IIRC the java-linux mailing list had a recent thread on the subject. You might want to check the archives for more. -past To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message