Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 May 2003 23:48:04 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        David Xu <davidxu@viatech.com.cn>
Cc:        Daniel Eischen <eischen@pcnet1.pcnet.com>
Subject:   Re: Patch for running Java2D demo (jdk-1.4.1p3_3)
Message-ID:  <3EB60924.A595C548@mindspring.com>
References:  <Pine.GSO.4.10.10305041355320.23588-100000@pcnet1.pcnet.com> <001701c3129c$78bdab00$0701a8c0@tiger>

next in thread | previous in thread | raw e-mail | index | archive | help
David Xu wrote:
> From: "Daniel Eischen" <eischen@pcnet1.pcnet.com>
> > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EB60924.A595C548>