Patch for running Java2D demo (jdk-1.4.1p3_3)

Daniel Eischen eischen at pcnet1.pcnet.com
Mon May 5 22:54:42 PDT 2003


On Mon, 5 May 2003, Terry Lambert wrote:

> > 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().
> 
> Rather than pointing at the standards over and over again, it
> occurs to me that I should ask you a question, instead, to
> emphasize our disconnect; so here it is:
> 
> 	If my theory of operation for the bug was incorrect,
> 	can you tell me *why* my suggested scheduler workaround
> 	fixed it, instead of having no effect or only a partial
> 	effect?

I'm assuming it is when a library/symbol is needed (not via
dlopen()), rtld-elf goes off and does whatever it has to to
find/load the symbol/library.  It takes an internal read
or write lock.  Then whatever thread it was running in gets
swapped out and another thread gets run.  This thread perhaps
causes other symbols to be referenced or perhaps does a dlopen()
and causes the lock to be taken again.

Read the rtld-elf source if you don't believe me.

-- 
Dan Eischen



More information about the freebsd-threads mailing list