From owner-freebsd-threads@FreeBSD.ORG Mon May 5 20:02:31 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5326D37B401 for ; Mon, 5 May 2003 20:02:31 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9E3D43F3F for ; Mon, 5 May 2003 20:02:30 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0018.cvx21-bradley.dialup.earthlink.net ([209.179.192.18] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19Csid-0007Z2-00; Mon, 05 May 2003 20:02:16 -0700 Message-ID: <3EB7256E.844A5958@mindspring.com> Date: Mon, 05 May 2003 20:01:02 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Daniel Eischen References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a41e42fb83694a87916a90e6181eb5b7c8a2d4e88014a4647c350badd9bab72f9c350badd9bab72f9c cc: David Xu cc: threads@freebsd.org Subject: Re: Patch for running Java2D demo (jdk-1.4.1p3_3) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2003 03:02:31 -0000 Daniel Eischen wrote: > > Personally, I don't think this is justifiable, and that the > > problem is actually a coding error in the threaded program, > > with failure to comply with the POSIX and Single UNIX > > Specification when writing your threaded program. The pthreads > > documentation seems to back me up (Chapter 12 of "Go Solo 2", > > as well as Corrigenda). > > It *is* an rtld-elf problem. I've protected dlfoo() all with the > same mutex and it still hangs. rtld-elf uses spinlocks in > areas that aren't called by dlfoo(). That doesn't say anything against what I've said. You haven't modified the JVM to not call pthreads unsafe operations over a potential involuntary context switch, without some method of preventing the context switch. Please see my quote from Chapter 12 of the Single UNIX Specification about how pthreads implementations are supposed serialize operations through unsafe operations themselves, instead of expecting the library to do it for them. You might as well serialize access to static buffers, as serialize access to non-threads reentrant system calls, if you are trying to make threads unsafe calls safe for threads. -- Terry