From owner-freebsd-java Thu Jun 6 2:38:51 2002 Delivered-To: freebsd-java@freebsd.org Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by hub.freebsd.org (Postfix) with ESMTP id 7345637B400 for ; Thu, 6 Jun 2002 02:38:47 -0700 (PDT) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Thu, 6 Jun 2002 10:38:43 +0100 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 3.16 #1) id 17FthB-0001KF-00; Thu, 06 Jun 2002 10:36:41 +0100 Date: Thu, 6 Jun 2002 10:36:41 +0100 (BST) From: Jan Grant X-X-Sender: cmjg@mail.ilrt.bris.ac.uk To: "Robert F. Ross" Cc: freebsd-java@freebsd.org Subject: Re: green vs. native threads In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Wed, 5 Jun 2002, Robert F. Ross wrote: > On the suggestion from people here about using native threads instead of > green threads I tried running the VM with -native. I never managed to get > select() or poll() behaving right through JNI with green threads. With > native threads, they appear to behave exactly as they should. The problem > is, with native threads my java process eats 100% CPU. When I try to > attach with gdb to see where this is happening, it appears to always > attach with a backtrace of: ... > Has anyone seen either of these issues or have any idea what may be > causing them? Is this on -stable? I've seen thread-enabled applications consume large amounts of CPU inside the libc_r. My guess was that the "blocking" calls like select are being faked by the thread library - which is fine if they've got other work to do - but if everything is waiting on a blocking call the whole caboodle goes into a busy loop waiting on one of the events you're "blocking" on. (Compiling apache with threading on -stable exhibited this behaviour.) I've no idea how or at what level the jvm interacts with the native threading system - haven't looked, don't particularly want to. jan -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk ...You're visualising the _duck_ taped over my _mouth_..? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message