Patch for running Java2D demo (jdk-1.4.1p3_3)

Terry Lambert tlambert2 at mindspring.com
Sun May 4 23:49:41 PDT 2003


David Xu wrote:
> From: "Daniel Eischen" <eischen at 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


More information about the freebsd-threads mailing list