From owner-freebsd-threads@FreeBSD.ORG Sun May 4 23:49:41 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 2CD1337B401 for ; Sun, 4 May 2003 23:49:41 -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 980A343F75 for ; Sun, 4 May 2003 23:49:40 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0107.cvx22-bradley.dialup.earthlink.net ([209.179.198.107] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19CZmq-0004ih-00; Sun, 04 May 2003 23:49:21 -0700 Message-ID: <3EB60924.A595C548@mindspring.com> Date: Sun, 04 May 2003 23:48:04 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: David Xu References: <001701c3129c$78bdab00$0701a8c0@tiger> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a413142e30dc8c32d103490e14f316b43193caf27dac41a8fd350badd9bab72f9c350badd9bab72f9c cc: threads@freebsd.org cc: Daniel Eischen 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: Mon, 05 May 2003 06:49:41 -0000 David Xu wrote: > From: "Daniel Eischen" > > Yes, I think so. You can try the patch I posted in: > > > > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=179964+0+archive/2003/freebsd-threads/20030504.freebsd-threads > > > > to see if that fixes the problem with rtld-elf. I don't want to commit it > > because it would break round-robin scheduling. > > Is there anyone working on rtld-elf problem? Dan is; Alexander Kabaev is. 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). You can't put training wheels on everything for everyone; the fix Dan posted (I suggested the fix, based on my suspicion that it was a programming error in the threaded program) is training wheels: it makes the illegal-according-to-POSIX assumption true, that the same thread that was running at the time of an involuntary context switch will get the CPU back, instead of a higher priority threads. It corrects the problem; ipso facto, the problem is that someone is making an illegal-according-to-POSIX assumption. The correct thing to do is to modify the JDK or any other threaded program to *NOT* make that assumption, or to acquire a scheduler mutex, if it wants to make the assumption, so that there's a serialization barrier. Again: the rtld-elf is an effect of a bad assumption on the part of the threaded program, not a real bug in rtld-elf. -- Terry