From owner-freebsd-java Thu Aug 8 13: 8:16 2002 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 7242337B400 for ; Thu, 8 Aug 2002 13:08:14 -0700 (PDT) Received: from turing.morons.org (turing.morons.org [209.237.229.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0739343E3B for ; Thu, 8 Aug 2002 13:08:14 -0700 (PDT) (envelope-from freebsd@spatula.net) Received: by turing.morons.org (Postfix, from userid 1001) id AE57DAB28; Thu, 8 Aug 2002 13:08:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by turing.morons.org (Postfix) with ESMTP id AD8FDA947; Thu, 8 Aug 2002 13:08:08 -0700 (PDT) Date: Thu, 8 Aug 2002 13:08:08 -0700 (PDT) From: Nick Johnson X-X-Sender: spatula@turing.morons.org To: Bill Huey Cc: freebsd-java@freebsd.org Subject: Re: Thread.sleep implementation In-Reply-To: <20020808190716.GA2757@gnuppy.monkey.org> Message-ID: <20020808130530.K13773-100000@turing.morons.org> X-what-happen: someone set up us the bomb X-Message-Flags: Spatula 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 Thu, 8 Aug 2002, Bill Huey wrote: > On Thu, Aug 08, 2002 at 07:48:01AM -0700, Nick Johnson wrote: > > I've noticed that in threads which are trying to make locks or wait to > > retry on some failure condition, the JVM tends to suddenly begin using > > tons of CPU, despite the presense of a Thread.sleep() call inside the > > loop. > > > > What seems to also happen is starvation of the other threads, almost as > > though Thread.sleep were implemented as a busy loop (?). I'll try to come > > up with a test case for this. I bring it up here in case someone closer > > to the JVM's internals might know what I'm talking about... > > Under what threading model ? Green threads with the native JVM (not hotspot), although now I'm beginning to wonder if the problem is related more to my second post; this particular thread is using Lucene, and reliably causing the JVM to spin its wheels in the native method RandomAccessFile.length. I suspect the problem may actually be there. That's the trouble with threads :/ Nick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message